This domain
public class Contact : DomainObject
{
private readonly IList<JobRecord> currentPositions;
private readonly IList<JobRecord> pastPositions;
public Contact()
{
currentPositions = new List<JobRecord>();
pastPositions = new List<JobRecord>();
}
public virtual IEnumerable<JobRecord> CurrentPositions
{
get { return currentPositions; }
}
public virtual IEnumerable<JobRecord> PastPositions
{
get { return pastPositions; }
}
}
public class JobRecord : DomainObject
{
public virtual string Position { get; set; }
}
generates this mapping
<list name="CurrentPositions" access="field.camelcase" cascade="all">
<key column="contact_key" />
<list-index />
<one-to-many class="JobRecord" />
</list>
<list name="PastPositions" access="field.camelcase" cascade="all">
<key column="contact_key" />
<list-index />
<one-to-many class="JobRecord" />
</list>
with a clear problem when the entity will be uploaded due to same key-column name for both collections.
So far you have to customize both collection using a "where" or different columns names.
An applier to disambiguate double usage unidirectional collections through key-column name would be appreciate.