public void Apply(IOneToManyCollectionInstance instance)
     {
 		if (instance.ChildType.IsSubclassOf(typeof(TenantEntity)))
         {
 				instance.ApplyFilter<TenantFilter>("tenantid = :tid");	
         }
     }
Ejemplo n.º 2
0
        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());
        }
Ejemplo n.º 3
0
        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());
        }
Ejemplo n.º 4
0
        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();
        }
Ejemplo n.º 5
0
        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);
 }
Ejemplo n.º 7
0
 public void Apply(IOneToManyCollectionInstance instance)
 {
     instance.ApplyFilter(FilterName);
 }