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: No index possible within a <properties> tag?
PostPosted: Fri Jul 25, 2008 9:59 am 
Newbie

Joined: Fri Jul 11, 2008 7:48 am
Posts: 5
Hi all,

my hibernate class Foo contains a many-to-one relation to the class Bar. I want an index on the column "bar_id". This does work with the following mapping:

Code:
<many-to-one foreign-key="foo_bar_fk" lazy="false" name="bar" class="Bar">
      <column name="bar_id" index="foo_bar_id_i" not-null="true"/>
    </many-to-one>


Now i want a unique key for my class Foo which also contains the "bar_id". This means i nest my many-to-one relation together with a property within a <properties> -tag:

Code:
<properties unique="true" name="foo_uk">
<many-to-one foreign-key="foo_bar_fk" lazy="false" name="bar" class="Bar">
      <column name="bar_id" index="foo_bar_id_i" not-null="true"/>
   
</many-to-one>
<property name="code" not-null="true" length="50"/>
</properties>


Now my unique key is produced without a problem, but my index is gone. I'm using the SchemaExport of Hibernate. My database is Oracle 10.02.

Does anyone know a solution for this problem?

Thanks,
Chris


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.