I currently use a <set> construct to hold my one-to-many collection. The hbm code is:
<set name="models" lazy="true" inverse="true" >
<key>
<column name="mf_db_site" />
<column name="mf_db_id" />
<column name="mf_duns_code" />
</key>
<one-to-many class="com.orci.ITSAM.hibernate.Model" />
</set>
I can get the list of models in my java code by calling parent.getModels();
I would like to be able to use a Map collection so that I could search for a single record in my collection, like, parent.getModels().get(someKeyObject);
I've tried to re-write the <set> construct as <map> but it needs an index field. The model records have a composit key of columns model_number and revision_number. How should the <map> construct look? Will hbm2java create a class for the composit index into the map?
Any help sould be appreciated.
David Robison
|