-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: [SchemaUpdate] + longvarchar + postgres
PostPosted: Mon Mar 19, 2007 11:20 am 
Beginner
Beginner

Joined: Mon Sep 12, 2005 3:27 am
Posts: 48
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.