-->
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: OracleMetaDataDialect VARCHAR2 COLUMN_SIZE in BYTE
PostPosted: Tue Jan 13, 2015 8:00 pm 
Newbie

Joined: Tue Jan 13, 2015 7:43 pm
Posts: 1
Hi,

I used Hibernate Tools 4.0.0 to generate POJO and hbm.xml files using a reveng.xml file from an Oracle 11 database.

I used : ojbdc6-11.2.0.3

<property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property>
<property name="hibernatetool.metadatadialect">org.hibernate.cfg.reveng.dialect.OracleMetaDataDialect</property>

all VARCHAR2 (CHAR) and NVARCHAR2 have an incorrect Length (x4)

I understand that 1 CHAR can contains 4 BYTES.

However, when I use the POJO to generate the schema (in Postgres or Oracle) all String fields are generated as VARCHAR2(CHAR) with the length in BYTES...


I checked the class org.hibernate.cfg.reveng.dialect.OracleMetaDataDialect and the query:
private static final String SQL_COLUMN_BASE actually looks for DATA_LENGTH in all_tab_columns.

I'm under the impression the query should looks for CHAR_LENGTH instead.


I appreciate any input you may have to help me to understand why DATA_LENGTH is used.

Thanks

Yannick


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.