Ejemplo n.º 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));
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 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)));
        }
Ejemplo n.º 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)));
        }
Ejemplo n.º 5
0
 protected ClassMap(AttributeStore <ClassMapping> attributes, MappingProviderStore providers)
     : base(providers)
 {
     this.attributes     = attributes;
     this.providers      = providers;
     this.optimisticLock = new OptimisticLockBuilder <ClassMap <T> >(this, (Action <string>)(value =>
     {
         AttributeStore <ClassMapping> temp_48 = attributes;
         ParameterExpression local_0           = Expression.Parameter(typeof(ClassMapping), "x");
         // ISSUE: method reference
         Expression <Func <ClassMapping, string> > temp_64 = Expression.Lambda <Func <ClassMapping, string> >((Expression)Expression.Property((Expression)local_0, (MethodInfo)MethodBase.GetMethodFromHandle(__methodref(ClassMapping.get_OptimisticLock))), new ParameterExpression[1]
         {
             local_0
         });
         string temp_65 = value;
         temp_48.Set <string>(temp_64, temp_65);
     }));
     this.polymorphism = new PolymorphismBuilder <ClassMap <T> >(this, (Action <string>)(value =>
     {
         AttributeStore <ClassMapping> temp_67 = attributes;
         ParameterExpression local_0           = Expression.Parameter(typeof(ClassMapping), "x");
         // ISSUE: method reference
         Expression <Func <ClassMapping, string> > temp_83 = Expression.Lambda <Func <ClassMapping, string> >((Expression)Expression.Property((Expression)local_0, (MethodInfo)MethodBase.GetMethodFromHandle(__methodref(ClassMapping.get_Polymorphism))), new ParameterExpression[1]
         {
             local_0
         });
         string temp_84 = value;
         temp_67.Set <string>(temp_83, temp_84);
     }));
     this.schemaAction = new SchemaActionBuilder <ClassMap <T> >(this, (Action <string>)(value =>
     {
         AttributeStore <ClassMapping> temp_86 = attributes;
         ParameterExpression local_0           = Expression.Parameter(typeof(ClassMapping), "x");
         // ISSUE: method reference
         Expression <Func <ClassMapping, string> > temp_102 = Expression.Lambda <Func <ClassMapping, string> >((Expression)Expression.Property((Expression)local_0, (MethodInfo)MethodBase.GetMethodFromHandle(__methodref(ClassMapping.get_SchemaAction))), new ParameterExpression[1]
         {
             local_0
         });
         string temp_103 = value;
         temp_86.Set <string>(temp_102, temp_103);
     }));
     this.Cache = new CachePart(typeof(T));
 }
Ejemplo n.º 6
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);

            collectionAttributes.SetDefault(x => x.Name, member.Name);

            keyMapping = new KeyMapping();
            keyMapping.AddDefaultColumn(new ColumnMapping {
                Name = entity.Name + "_id"
            });
        }