Esempio n. 1
0
        public PropertyPart(Member property, Type parentType)
        {
            columns   = new ColumnMappingCollection <PropertyPart>(this);
            access    = new AccessStrategyBuilder <PropertyPart>(this, value => attributes.Set(x => x.Access, value));
            generated = new PropertyGeneratedBuilder(this, value => attributes.Set(x => x.Generated, value));

            this.property   = property;
            this.parentType = parentType;
        }
Esempio n. 2
0
 protected ManyToManyPart(Type entity, Member member, Type collectionType)
     : base(entity, member, collectionType)
 {
     this.childType        = collectionType;
     this.fetch            = new FetchTypeExpression <ManyToManyPart <TChild> >(this, (Action <string>)(value => this.collectionAttributes.Set("Fetch", 2, (object)value)));
     this.notFound         = new NotFoundExpression <ManyToManyPart <TChild> >(this, (Action <string>)(value => this.relationshipAttributes.Set("NotFound", 2, (object)value)));
     this.childKeyColumns  = new ColumnMappingCollection <ManyToManyPart <TChild> >(this);
     this.parentKeyColumns = new ColumnMappingCollection <ManyToManyPart <TChild> >(this);
 }
Esempio n. 3
0
 protected JoinedSubClassPart(string keyColumn, AttributeStore attributes, MappingProviderStore providers)
     : base(providers)
 {
     this.providers  = providers;
     this.attributes = attributes;
     columns         = new ColumnMappingCollection <JoinedSubClassPart <TSubclass> >(this)
     {
         keyColumn
     };
 }
Esempio n. 4
0
        protected ManyToManyPart(Type entity, Member member, Type collectionType)
            : base(entity, member, collectionType)
        {
            childType = collectionType;

            fetch    = new FetchTypeExpression <ManyToManyPart <TChild> >(this, value => collectionAttributes.Set("Fetch", Layer.UserSupplied, value));
            notFound = new NotFoundExpression <ManyToManyPart <TChild> >(this, value => relationshipAttributes.Set("NotFound", Layer.UserSupplied, value));

            childKeyColumns  = new ColumnMappingCollection <ManyToManyPart <TChild> >(this);
            parentKeyColumns = new ColumnMappingCollection <ManyToManyPart <TChild> >(this);
        }
Esempio n. 5
0
        public PropertyPart(Member member, Type parentType)
        {
            columns   = new ColumnMappingCollection <PropertyPart>(this);
            access    = new AccessStrategyBuilder <PropertyPart>(this, value => attributes.Set("Access", Layer.UserSupplied, value));
            generated = new PropertyGeneratedBuilder(this, value => attributes.Set("Generated", Layer.UserSupplied, value));

            this.member     = member;
            this.parentType = parentType;

            SetDefaultAccess();
        }
Esempio n. 6
0
        protected OneToManyPart(Type entity, Member member, Type collectionType)
            : base(entity, member, collectionType)
        {
            this.entity = entity;
            childType   = collectionType;

            keyColumns = new ColumnMappingCollection <OneToManyPart <TChild> >(this);
            notFound   = new NotFoundExpression <OneToManyPart <TChild> >(this, value => relationshipAttributes.Set("NotFound", Layer.UserSupplied, value));

            collectionAttributes.Set("Name", Layer.Defaults, member.Name);
        }
        protected OneToManyPart(Type entity, Member member, Type collectionType)
            : base(entity, member, collectionType)
        {
            this.entity = entity;
            childType   = collectionType;

            keyColumns = new ColumnMappingCollection <OneToManyPart <TChild> >(this);
            cascade    = new CollectionCascadeExpression <OneToManyPart <TChild> >(this, value => collectionAttributes.Set(x => x.Cascade, value));
            notFound   = new NotFoundExpression <OneToManyPart <TChild> >(this, value => relationshipAttributes.Set(x => x.NotFound, value));

            collectionAttributes.SetDefault(x => x.Name, member.Name);
        }
        protected ManyToManyPart(Type entity, Member member, Type collectionType)
            : base(entity, member, collectionType)
        {
            this.entity = entity;
            childType   = collectionType;

            fetch    = new FetchTypeExpression <ManyToManyPart <TChild> >(this, value => collectionAttributes.Set(x => x.Fetch, value));
            notFound = new NotFoundExpression <ManyToManyPart <TChild> >(this, value => relationshipAttributes.Set(x => x.NotFound, value));

            childKeyColumns  = new ColumnMappingCollection <ManyToManyPart <TChild> >(this);
            parentKeyColumns = new ColumnMappingCollection <ManyToManyPart <TChild> >(this);
        }
Esempio n. 9
0
        protected OneToManyPart(Type entity, Member member, Type collectionType)
            : base(entity, member, collectionType)
        {
            this.entity = entity;
            childType   = collectionType;

            keyColumns = new ColumnMappingCollection <OneToManyPart <TChild> >(this);
            cascade    = new CollectionCascadeExpression <OneToManyPart <TChild> >(this, value =>
            {
                var current = collectionAttributes.Get("Cascade") as string;
                collectionAttributes.Set("Cascade", Layer.UserSupplied, current == null ? value : string.Format("{0},{1}", current, value));
            });
            notFound = new NotFoundExpression <OneToManyPart <TChild> >(this, value => relationshipAttributes.Set("NotFound", Layer.UserSupplied, value));

            collectionAttributes.Set("Name", Layer.Defaults, member.Name);
        }
 public JoinedSubClassPart(AttributeStore underlyingStore)
 {
     attributes = new AttributeStore <JoinedSubclassMapping>(underlyingStore);
     columns    = new ColumnMappingCollection <JoinedSubClassPart <TSubclass> >(this);
 }
Esempio n. 11
0
 public ElementPart(Type entity)
 {
     this.entity = entity;
     columns     = new ColumnMappingCollection <ElementPart>(this);
 }