Project
ConfORM
Priority
Normal
Type
Feature
State
Fixed
Assignee
Unassigned
Subsystem
Core
Fix versions
1.0.0.4
Affected versions
1.0.0Alpha3
Fixed in build
Next Build
  • Created by   Fabio Maulo
    2 years ago (28 Sep 2010 13:52)
 
CfgORM-6 Applier to disambiguate double usage of one-to-many unidirectional collections
0
Issue is visible to: All Users
  The issue is visible to the selected user group only
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.
Comments (0)
 
History
 
Linked Issues (?)
 
Issue has no comments