Example #1
0
 public ClassMap()
 {
     optimisticLock = new OptimisticLockBuilder <ClassMap <T> >(this, value => attributes.Set(x => x.OptimisticLock, value));
     polymorphism   = new PolymorphismBuilder <ClassMap <T> >(this, value => attributes.Set(x => x.Polymorphism, value));
     schemaAction   = new SchemaActionBuilder <ClassMap <T> >(this, value => attributes.Set(x => x.SchemaAction, value));
     Cache          = new CachePart(typeof(T));
 }
Example #2
0
 protected ClassMap(AttributeStore attributes, MappingProviderStore providers)
     : base(providers)
 {
     this.attributes = attributes;
     this.providers  = providers;
     optimisticLock  = new OptimisticLockBuilder <ClassMap <T> >(this, value => attributes.Set("OptimisticLock", Layer.UserSupplied, value));
     polymorphism    = new PolymorphismBuilder <ClassMap <T> >(this, value => attributes.Set("Polymorphism", Layer.UserSupplied, value));
     schemaAction    = new SchemaActionBuilder <ClassMap <T> >(this, value => attributes.Set("SchemaAction", Layer.UserSupplied, value));
     Cache           = new CachePart(typeof(T));
 }
Example #3
0
        protected ToManyBase(Type entity, Member member, Type type)
        {
            this.entity = entity;
            this.member = member;
            AsBag();
            access         = new AccessStrategyBuilder <T>((T)this, value => collectionAttributes.Set(x => x.Access, value));
            fetch          = new FetchTypeExpression <T>((T)this, value => collectionAttributes.Set(x => x.Fetch, value));
            optimisticLock = new OptimisticLockBuilder <T>((T)this, value => collectionAttributes.Set(x => x.OptimisticLock, value));
            cascade        = new CollectionCascadeExpression <T>((T)this, value => collectionAttributes.Set(x => x.Cascade, value));

            SetDefaultCollectionType(type);
            SetCustomCollectionType(type);
            Cache = new CachePart(entity);

            collectionAttributes.SetDefault(x => x.Name, member.Name);
            relationshipAttributes.SetDefault(x => x.Class, new TypeReference(typeof(TChild)));
        }
Example #4
0
        //PROTOTYPE1: ADDED

        protected ToManyBase(Type entity, Member member, Type type)
        {
            this.entity = entity;
            this.member = member;
            AsBag();
            access         = new AccessStrategyBuilder <T>((T)this, value => collectionAttributes.Set("Access", Layer.UserSupplied, value));
            fetch          = new FetchTypeExpression <T>((T)this, value => collectionAttributes.Set("Fetch", Layer.UserSupplied, value));
            optimisticLock = new OptimisticLockBuilder <T>((T)this, value => collectionAttributes.Set("OptimisticLock", Layer.UserSupplied, value));
            cascade        = new CollectionCascadeExpression <T>((T)this, value => collectionAttributes.Set("Cascade", Layer.UserSupplied, value));

            SetDefaultCollectionType();
            SetCustomCollectionType(type);
            SetDefaultAccess();
            Cache = new CachePart(entity);

            collectionAttributes.Set("Name", Layer.Defaults, member.Name);
            relationshipAttributes.Set("Class", Layer.Defaults, new TypeReference(typeof(TChild)));
        }
Example #5
0
        protected ToManyBase(Type entity, Member member, Type type)
        {
            this.entity = entity;
            this.member = member;
            AsBag();
            access  = new AccessStrategyBuilder <T>((T)this, value => collectionAttributes.Set("Access", Layer.UserSupplied, value));
            fetch   = new FetchTypeExpression <T>((T)this, value => collectionAttributes.Set("Fetch", Layer.UserSupplied, value));
            cascade = new CollectionCascadeExpression <T>((T)this, value =>
            {
                var current = collectionAttributes.Get("Cascade") as string;
                collectionAttributes.Set("Cascade", Layer.UserSupplied, current == null ? value : string.Format("{0},{1}", current, value));
            });

            SetDefaultCollectionType();
            SetCustomCollectionType(type);
            SetDefaultAccess();
            Cache = new CachePart(entity);

            collectionAttributes.Set("Name", Layer.Defaults, member.Name);
            relationshipAttributes.Set("Class", Layer.Defaults, new TypeReference(typeof(TChild)));
        }