-->
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.  [ 2 posts ] 
Author Message
 Post subject: Hibernate 2.0.3 generates incorrect SQL on oracle.
PostPosted: Mon Mar 22, 2004 9:09 am 
Newbie

Joined: Mon Mar 22, 2004 8:42 am
Posts: 2
I've got a table on an Oracle 9i (9.2.0.1.0) with rather long column names, the longest of which is 29 characters. Oracle limits the name of a column to 30 characters.

When I use Hibernate to fetch a record from the table, it generates the following statement:
Code:
select statetra0_.STATE_TRANSITION_CONDITION_ID as STATE_TR1___,
operatio1_.OPERATION_NAME as OPERATION_NAME0_,
operatio1_.OPERATION_CLASS as OPERATIO2_0_,
statetra0_.STATE_TRANSITION_CONDITION_ID as STATE_TRANSITION_CONDITION_ID1_,
statetra0_.ELEMENT as ELEMENT1_,
statetra0_.PARAMETER as PARAMETER1_,
statetra0_.OPERATION_NAME as OPERATIO4_1_
from STATETRANSITIONCONDITION statetra0_
left outer join STATETRANSITIONOPERATION operatio1_ on statetra0_.OPERATION_NAME=operatio1_.OPERATION_NAME
where statetra0_.STATE_TRANSITION_ID=1001;


The problem is the STATE_TRANSITION_CONDITION_ID column. Hibernate tacks on 2 bytes for the column name, which exceeds Oracle's limitations and causes the statement to fail.

The obvious workaround is to simply shorten the column name, but I feel Hibernate should realise the generated columnname is too long and short it on its own.

Kind regards,

Cooper


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 22, 2004 10:00 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Please use 2.1.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.