So let me see. If I have the following classes:
Code:
public class Account {
private ContactInformation contactInfo;
public ContactInformation getContactInfo() {
return this.contactInfo;
}
public void setContactInformation(ContactInformation info) {
this.contactInfo = info;
}
}
public class ContactInformation {
private EmailAddress emailAddress;
private Phone phone;
// getter and setters
}
And I wanted my current Account.hbm.xml to look like this:
Code:
<set name="contactInfo.phones" inverse="false" lazy="true" cascade="all-delete-orphan">
<key column="account"/>
<one-to-many class="data.account.Phone"/>
</set>
Instead, using the <component> tag, it would appear that I have to use <composite-element> for a collection. So...
Code:
<set name="contactInfo" inverse="false" lazy="true" cascade="all-delete-orphan">
<key column="account"/>
<composite-element class="data.contact.ContactInformation">
<property name="phones"/>
<one-to-many class="data.account.Phone"/>
</composite-element>
</set>
Yes? But there is no support for <one-to-many> with composite-element. Ideas?