We have the code below. The association is wrong because there is no 'Notitie' on the FactuurEntity. There is a 'NotitieId' present. The association is NOT produced in the DB. The RootEntity contains the Id of the entities and has a HierachyRoot attribute and a key generator.
using Xtensive.Orm;
namespace Fortrus.DataWarehouse.Model
{
[TableMapping("Notitie")]
[Index("NotitieId", Name = "IndexNotitieNotitieId")]
public partial class NotitieEntity : RootEntity
{
[Field(Nullable = false)]
public long NotitieId { get; set; }
[Association(OnOwnerRemove = OnRemoveAction.Cascade,
OnTargetRemove = OnRemoveAction.Clear, PairTo = "Notitie")]
public EntitySet<FactuurEntity> FactuurList { get; set; }
}
}
using System;
using Xtensive.Orm;
namespace Fortrus.DataWarehouse.Model
{
[TableMapping("Factuur")]
[Index("FactuurId", Name = "IndexFactuurFactuurId")]
[Index("NotitieId", Name = "IndexFactuurNotitieId")]
public partial class FactuurEntity : RootEntity
{
[Field(Nullable = false)]
public long FactuurId { get; set; }
[Field(Nullable=false)]
public long NotitieId { get; set; }
}
}
answered
Sep 12 '14 at 08:12
Paul Sinnema
261●88●88●96