Commit f1ca6967 authored by Matija Obreza's avatar Matija Obreza
Browse files

BetterHSQLDialect allows mysql compatible use of @Lob (no length)

parent de06e8c6
package org.genesys.blocks.util;
import java.sql.Types;
import org.hibernate.dialect.HSQLDialect;
/**
* Hibernate's HSQL dialect uses clob(255) when length is not specified.
*
* Example: For JDBC connection to <code>jdbc:hsqldb:mem:catalog;sql.syntax_mys=true;sql.ignore_case=true</code>
* set Hibernate dialect to <code>org.genesys.blocks.util.BetterHSQLDialect</code>.
*/
public class BetterHSQLDialect extends HSQLDialect {
// http://stackoverflow.com/questions/12876551/hibernate-4-1-with-hsqldb-gives-data-exception-string-data-right-truncation
public BetterHSQLDialect() {
super();
registerColumnType(Types.CLOB, "clob");
registerColumnType(Types.BLOB, "blob");
}
}
\ No newline at end of file
......@@ -35,14 +35,12 @@ public class AccessToken implements Serializable {
@Column(unique = true, length = 100)
private String authenticationId;
@Lob
@Column(length= 20 * 1024)
private byte[] token;
@Column(length = 100)
private String username;
@Column(length = 100)
private String clientId;
@Lob
@Column(length= 20 * 1024)
private byte[] authentication;
@Column(length = 100)
private String refreshToken;
......
......@@ -34,11 +34,9 @@ public class RefreshToken implements Serializable {
private String tokenId;
@Lob
@Column(length= 20 * 1024)
private byte[] token;
@Lob
@Column(length= 20 * 1024)
private byte[] authentication;
public void setTokenId(final String tokenId) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment