public void Apply(IOneToManyCollectionInstance instance) { if (instance.ChildType.IsSubclassOf(typeof(TenantEntity))) { instance.ApplyFilter<TenantFilter>("tenantid = :tid"); } }
public void Apply(IOneToManyCollectionInstance instance) { instance.Key.Column(instance.EntityType.Name.ToDatabaseName() + "_ID"); instance.Cascade.AllDeleteOrphan(); //instance.Inverse(); if (typeof (IPermanent).IsAssignableFrom(instance.ChildType)) { instance.ApplyFilter<IsDeletedFilter>("IS_DELETED = :DeleteFlag"); } Debug.WriteLine("----HasManyConvention----"+instance.EntityType.Name.ToDatabaseName() + "_ID" + instance.EntityType.ToString()+" "+instance.ChildType.ToString()); }
public void Apply(IOneToManyCollectionInstance instance) { instance.Key.Column(instance.EntityType.Name.ToDatabaseName() + "_ID"); instance.Cascade.AllDeleteOrphan(); //instance.Inverse(); if (typeof(IPermanent).IsAssignableFrom(instance.ChildType)) { instance.ApplyFilter <IsDeletedFilter>("IS_DELETED = :DeleteFlag"); } Debug.WriteLine("----HasManyConvention----" + instance.EntityType.Name.ToDatabaseName() + "_ID" + instance.EntityType.ToString() + " " + instance.ChildType.ToString()); }
public void Apply(IOneToManyCollectionInstance instance) { instance.ApplyFilter<DeletedFilter>(); instance.Key.Column(instance.EntityType.Name + "Fk"); //demonstrate business requirement - all has many relation should be fethced eagerly //to alleviate classic N+1 problem when iterating an "entity list property" and //access properties on each iterator item //set batch 5 to eager fetch at most 5 entities when accessing a collection property. //its a good candidate for a general purpose query performance tuning //Note: the global class level adonet.batch_size can be set in nhibernate.config file instance.BatchSize(5); instance.Cascade.All(); }
public void Apply(IOneToManyCollectionInstance instance) { instance.ApplyFilter <DeletedFilter>(); instance.Key.Column(instance.EntityType.Name + "Fk"); //demonstrate business requirement - all has many relation should be fethced eagerly //to alleviate classic N+1 problem when iterating an "entity list property" and //access properties on each iterator item //set batch 5 to eager fetch at most 5 entities when accessing a collection property. //its a good candidate for a general purpose query performance tuning //Note: the global class level adonet.batch_size can be set in nhibernate.config file instance.BatchSize(5); instance.Cascade.All(); }
public void Apply(IOneToManyCollectionInstance instance) { instance.ApplyFilter(FilterName, FilterCondition); }
public void Apply(IOneToManyCollectionInstance instance) { instance.ApplyFilter(FilterName); }