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?
|