-->
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: Define Indexes in .hbm.xml?
PostPosted: Mon May 02, 2005 2:06 pm 
Beginner
Beginner

Joined: Wed Apr 13, 2005 2:03 pm
Posts: 34
Hibernate 3.0
MySQL

I'm hoping to use the .hbm.xml files as a set of descriptors to bootstrap my system into life after a new install. Right now I can use the .hbm files and either createSchema() or my own code to build the appropriate tables and foreign keys.

What I'm hoping to do though is also encode secondary indexes in the .hbm.xml somehow e.g. if I have a class called "person" I want to define not only the PK and FK indexes but also one on "firstname, lastname" (a common user sort order), etc.

Is there a way to either explicitely define a secondary index in a mapping file such that createSchema() will recognize it?

Alternately, is there a way to safely embed additional elements into the mapping file such that I can then read them in a second pass with my own code and then add the indexes with my own code? It seems like the DTD is pretty strict, but is there an extension point I could slip some other information in with?


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.