I have something simple: please excuse my use of c#
Code:
public class Person
{
private int m_PersonID
List<Address> m_Addresses;
public Person()
{
}
public int PersonID{get{return m_PersonID;}set{m_personID=value;}}
public List<Address> Addresses{get{return m_Addresses;}set{m_Addresses=value;}}
}
public class Address
{
private int m_AddressID
public Address()
{
}
public int AddressID{get{return m_AddressID;}set{m_AddressID=value;}}
}
I have 3 tables that create this mapping, since i want to support addresses belonging to things other than Person
TABLES: Person, Address, PersonAddress
I have Keys inside the tables that link the 2 classes together via PersonAddress, PersonAddress table contains PersonAddressID, PersonID, and AddressID.
Simple RDBMS
I have seen many examples on the help notes about linking direct ie Person directly Many to One on address, but since address is a property of Person and could also be a property of other classes such as Corporation(), i dont want to tie the classes together directly.
How do I represent this in hbm.xml
Thanks in advance and excuse my ignorance.