-->
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.  [ 4 posts ] 
Author Message
 Post subject: oracle metadata
PostPosted: Wed Jan 28, 2004 7:39 pm 
Beginner
Beginner

Joined: Wed Jan 28, 2004 3:42 pm
Posts: 36
Hi,

I looked through the FAQ and search around but could not find an answer to this question, which I'm sure must've come up before.

When generating the mapping file using middlegen all varchar2 fields appears with columnlength * 4? Number "length" is picked up correctly. I double checked using desc in sqlplus when connected to the source database. I'm using the ojdbc14.jar jdbc drivers for oracle 9.2.0

Any ideas?

Thank you,
Peter


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2004 4:43 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
A small example would be good just to illustrate.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2004 2:07 pm 
Beginner
Beginner

Joined: Wed Jan 28, 2004 3:42 pm
Posts: 36
Hi David,

I'm sorry, here's an example:

This is from the source database:

SQL> desc imihs_commitment_doc_t
Name Null? Type
----------------------------------------- -------- ----------------------------
FDOC_NBR NOT NULL VARCHAR2(36 CHAR)
FDOC_EXPLAIN_TXT VARCHAR2(1600 CHAR)
CATEGORY VARCHAR2(160 CHAR)
PRIMARY_RECIPIENT VARCHAR2(160 CHAR)
PRIMARY_DEPARTMENT VARCHAR2(160 CHAR)
SECONDARY_RECIPIENT VARCHAR2(160 CHAR)
SECONDARY_DEPARTMENT VARCHAR2(160 CHAR)
TOTAL_AMT NUMBER(19,2)

Middlegen generates the following:

<id
name="fdocNbr"
type="java.lang.String"
column="FDOC_NBR"
>
<generator class="assigned" />
</id>

<property
name="fdocExplainTxt"
type="java.lang.String"
column="FDOC_EXPLAIN_TXT"
length="4000"
/>
<property
name="category"
type="java.lang.String"
column="CATEGORY"
length="640"
/>
<property
name="primaryRecipient"
type="java.lang.String"
column="PRIMARY_RECIPIENT"
length="640"
/>
<property
name="primaryDepartment"
type="java.lang.String"
column="PRIMARY_DEPARTMENT"
length="640"
/>
<property
name="secondaryRecipient"
type="java.lang.String"
column="SECONDARY_RECIPIENT"
length="640"
/>
<property
name="secondaryDepartment"
type="java.lang.String"
column="SECONDARY_DEPARTMENT"
length="640"
/>
<property
name="totalAmt"
type="java.math.BigDecimal"
column="TOTAL_AMT"
length="19"
/>


The reason why I think might have something to do with the jdbc metadata is because my sql client (DbVisualizer) reports the same wrong values!

Thanks,
Peter


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2004 10:27 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
I would agree that this is most likely to be the JDBC driver as the length attribute is taken from the JDBC drivers meta data directly. Oracle has had a few bugs in their JDBC drivers from time to time. Try the latest or a some alternate JDBC driver release.


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

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.