Hi,
I'm trying to generate code from my database, and I've got a table Person, with key personpk, a role wih key rolepk and a join table j_person_role that matches people and the roles on the above primary keys. Now I've generated the mapping files running the tools, and then I changed the Person.hbm.xml so that it states:
Code:
<set name="roles" inverse="false" table="j_person_role">
<key>
<column name="personpk" length="20" />
</key>
<one-to-many column="rolepk" unique="true" class="g2.database.mapping.Role" />
</set>
but when I generate the DAO and Java Classes, I've got that Person contains a set of JPersonRole objects, that point to the Role objects, while I'd like to get a direct link from Person to Role. So instead of this:
Code:
public class Person implements java.io.Serializable {
private Set<JPersonRole> JPersonRoles = new HashSet<JPersonRole>(0);
....
I'd like to get:
Code:
public class Person implements java.io.Serializable {
private Set<Role> Role = new HashSet<Role>(0);
....
How can I get this? Is there a way to force the tools to use the modified mappings?
Thanks,
Luca