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;
        }
示例#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);
 }
示例#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
     };
 }
示例#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);
        }
示例#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();
        }
示例#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);
        }
示例#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);
 }
示例#11
0
 public ElementPart(Type entity)
 {
     this.entity = entity;
     columns     = new ColumnMappingCollection <ElementPart>(this);
 }