-->
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: Auto generated index name too long
PostPosted: Thu Sep 11, 2008 5:09 pm 
Newbie

Joined: Sun Sep 07, 2008 9:32 am
Posts: 4
Hibernate version: 3.2.5

Hi,
I have an hbm file which contains hierarchy of several classes using <union-subclass> while only the concrete classes are abstract=false.
The top class in the hierarchy has a property which is indexed (index="i_1").
The depth of the hierarchy is about 6 classes which as I mentioned before only the concrete classes have tables.
The problem I'm facing is that hibernate generates the name of the index by concatenating all tables name in the hierarchy and in the and adding the name I specified for it.
For example: Assume the hierarchy is:
<class=Class1 abstract=true>
<property name="archived" column="Archived" type="boolean" index="i_1"/>
<union-subclass name=Class2 abstract=true>
<union-subclass name=Class3 abstract=true>
<union-subclass name=Class4 abstract=true>
<union-subclass name=Class5 abstract=true>
<union-subclass name=Class6 abstract=false>
</union-subclass>
</union-subclass>
</union-subclass>
</union-subclass>
</union-subclass>
</class>

I declared the index for a property inside Class1.
Hibernate generates the index name to be:
"Class1Class2Class3Class4Class5Class6i_1"
The problem is that this name is too long and the index is not being created!!!

How can I tell hibernate to disable this auto generated index name and use only the name I specified (e.g. "i_1").
I will really appreciate any help,
Thanks,
Iram

_________________
Iram Lewinger
Software Engineer
Cisco


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.