Hi all,
I am a new hibernate developers so my question might seem easy...
I have the following mapping xml...
------------------------------------------------------------------------
<class name="essex.cc403.hbeans.User" table="USER">
<id name="id" type="int" column="USER_ID">
<meta attribute="scope-set">protected</meta>
<generator class="native"/>
</id>
...
<many-to-one name="rank" class="essex.cc403.hbeans.Rank" column="RANK_ID"/>
</class>
<class name="essex.cc403.hbeans.Rank" table="RANK">
<id name="rankID" type="int" column="RANK_ID">
<meta attribute="scope-set">protected</meta>
<generator class="native"/>
</id>
...
<set name="Users" cascade="all" inverse="true" lazy="true">
<key column="RANK_ID"/>
<one-to-many class="essex.cc403.hbeans.User"/>
</set>
</class>
------------------------------------------------------------------------
When I generate the Java classes I get the following constructors for Rank...
------------------------------------------------------------------------
Code:
/** full constructor */
public Rank(String name, boolean canBook, boolean canDeleteAccount, boolean canViewBookings, boolean canEditBookings, boolean canCancelBookings, Set Users) {
this.name = name;
this.canBook = canBook;
this.canDeleteAccount = canDeleteAccount;
this.canViewBookings = canViewBookings;
this.canEditBookings = canEditBookings;
this.canCancelBookings = canCancelBookings;
this.Users = Users;
}
/** default constructor */
public Rank() {
}
/** minimal constructor */
public Rank(boolean canBook, boolean canDeleteAccount, boolean canViewBookings, boolean canEditBookings, boolean canCancelBookings, Set Users) {
this.canBook = canBook;
this.canDeleteAccount = canDeleteAccount;
this.canViewBookings = canViewBookings;
this.canEditBookings = canEditBookings;
this.canCancelBookings = canCancelBookings;
this.Users = Users;
}
------------------------------------------------------------------------
Is it possible to give a directive inside the mapping xml file so that the code generator will omit the Set Users argument at the constructor?