Hello,
as far as i understood, the dialects of Hibernate allows you to make the class-table-definiton/mapping so database-independent as possible. Now i have a problem, that i want to have the possibilty to use either PostgreSQL or HSQLD as backend. But both databases use different data types. But now i stumbled about following problem:
I want to store a larger amount of characters in one column. Postgres only knows "text"-datatype for this purpose, but HSQLDB only knows "longvarchar"-datatype for this.
I tried to use the hsqldb-datatype "longvarchar" for one column:
Code:
@Column(columnDefinition = "LONGVARCHAR")
and to register hsqldb-datatype "longvarchar" for
PostgreSQL:
Code:
registerColumnType(Types.CLOB, "longvarchar"); //$NON-NLS-1$
but SchemaUpdate seems to ignore this mapping - it tries to create the column in the table further as type "longvarchar" insteadof "clob".
Code:
14:24:51,730 ERROR [SchemaUpdate] Unsuccessful: create table TAudit_Changed_Field (id int8 not null, afterValue LONGVARCHAR, beforeValue LONGVARCHAR, timeMillis int8 not null, field varchar(255), auditRecord_entity varchar(255), auditRecord_timeMillis int8, auditRecord_changedBy varchar(255), auditRecord_action int4, auditRecord_identifier varchar(255), primary key (id))
14:24:51,730 ERROR [SchemaUpdate] ERROR: type "LONGVARCHAR" does not exist
Any idea?