Hello all,
I was wondering whether it would be possible to modify from code the properties in the XML mapping files. I have this mapping file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.Owners">
<id column="ID" name="id" type="long">
<generator class="native"/>
</id>
<bag name="news" table="Owners_Houses">
<key column="Owner_ID"/>
<many-to-many class="com.Houses" column="House_ID" order-by="Street_Name"/>
</bag>
</class>
</hibernate-mapping>
I would like to modify from code the "order-by" attribute so I can control how house objects are sorted within the collection of houses in each owner. For example I could sort houses by price, street name, etc...
Any ideas?
|