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 identifier too long
PostPosted: Thu Mar 11, 2010 1:57 pm 
Newbie

Joined: Thu Mar 11, 2010 1:47 pm
Posts: 2
Greetings!

A generated Oracle select statement below yielded java.sql.SQLException: ORA-00972: identifier is too long. The dialect is set to oracle10 already. Is there any way to control and constrain the generated identifiers. And one more detail. We are using JPA annotations, not XML mapping files. Thanks in advance for any suggestions.

-Aaron

select irgcluster0_.IRG_CLUSTER_ID as IRG1_2_1_,
irgcluster0_.CREATED_DATE as CREATED2_2_1_,
irgcluster0_.CREATOR_ID as CREATOR3_2_1_,
irgcluster0_.LAST_UPD_DATE as LAST4_2_1_,
irgcluster0_.LAST_UPD_ID as LAST5_2_1_,
irgcluster0_.CLUSTER_IRG_CODE as CLUSTER6_2_1_,
irgcluster0_.IRG_CLUSTER_DESC as IRG7_2_1_,
irgcluster0_.PHS_ORG_CODE as PHS8_2_1_,
components1_.IRG_CLUSTER_ID as IRG1_3_,
component2_.IRG_CLUSTER_COMPONENT_ID as components2_3_,
component2_.IRG_CLUSTER_COMPONENT_ID as IRG1_1_0_,
component2_.CREATED_DATE as CREATED2_1_0_,
component2_.CREATOR_ID as CREATOR3_1_0_,
component2_.LAST_UPD_DATE as LAST4_1_0_,
component2_.LAST_UPD_ID as LAST5_1_0_,
component2_.IRG_CLUSTER_ID as IRG7_1_0_,
component2_.DEFERRAL_IDENTIFIER_FLAG as DEFERRAL6_1_0_,
component2_.SRA_DESIGNATOR as SRA8_1_0_,
component2_.SRA_FLEX as SRA9_1_0_,
component2_.SRG_CODE as SRG10_1_0_,
component2_.SRG_FLEX as SRG11_1_0_
from IRG_CLUSTERS_T irgcluster0_
left outer join IRG_CLUSTERS_T_IRG_CLUSTER_COMPONENTS_T components1_ on irgcluster0_.IRG_CLUSTER_ID =
components1_.IRG_CLUSTER_ID
left outer join IRG_CLUSTER_COMPONENTS_T component2_ on components1_.components_IRG_CLUSTER_COMPONENT_ID =
component2_.IRG_CLUSTER_COMPONENT_ID
where irgcluster0_.IRG_CLUSTER_ID = ?


Top
 Profile  
 
 Post subject: Re: Oracle identifier too long
PostPosted: Thu Mar 11, 2010 3:31 pm 
Regular
Regular

Joined: Thu May 07, 2009 5:56 am
Posts: 94
Location: Toulouse, France
By default, Hibernate assumes that an entity's name corresponds to a database table of the same name and that an entity's data member names correspond to database columns with the same names.

Use @Table, @Column, @JoinColumn and @JoinTable to override this default behavior. Valid identifier in Oracle is limited to 30 characters.

_________________
everything should be made as simple as possible, but not simpler (AE)


Top
 Profile  
 
 Post subject: Re: Oracle identifier too long
PostPosted: Fri Sep 10, 2010 6:35 am 
Newbie

Joined: Wed Aug 11, 2010 7:30 am
Posts: 2
What if the identifier that is too long is a generated foreign key? It's probably worth noting that I am using JPA 2 annotations and @Inheritance(strategy=InheritanceType.TABLE_PER_CLASS).

Thanks in advance!


Top
 Profile  
 
 Post subject: Re: Oracle identifier too long
PostPosted: Sat Sep 11, 2010 4:49 am 
Newbie

Joined: Tue Aug 24, 2010 7:04 am
Posts: 14
I also do not think that it is problem with the value of any keys, it is the length of your table name. IRG_CLUSTERS_T_IRG_CLUSTER_COMPONENTS_T exceed the limit of 30 characters. Use the annotations that hallmit has suggested to rename your table name.

Quote:
Maximum identifier length of 30 characters
Oracle only allows up to 30 characters for table-, field- and constraint names. If you are porting from an existing schema with longer identifiers then you have to truncate them.

http://jnotes.jonasfischer.net/2009/07/ ... rst-steps/

Kind regards,
Michael


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.