public NestedCompositeElementPart(Type entity, Member member)
            : base(entity, member)
        {
            Access = new AccessStrategyBuilder <NestedCompositeElementPart <T> >(this, value => attributes.Set("Access", Layer.UserSupplied, value));

            SetDefaultAccess();
        }
 public VersionPart(Type entity, Member property)
 {
     this.entity   = entity;
     this.property = property;
     access        = new AccessStrategyBuilder <VersionPart>(this, value => attributes.Set(x => x.Access, value));
     generated     = new VersionGeneratedBuilder <IVersionMappingProvider>(this, value => attributes.Set(x => x.Generated, value));
 }
Example #3
0
 public AnyPart(Type entity, Member property)
 {
     this.entity   = entity;
     this.property = property;
     access        = new AccessStrategyBuilder <AnyPart <T> >(this, value => attributes.Set(x => x.Access, value));
     cascade       = new CascadeExpression <AnyPart <T> >(this, value => attributes.Set(x => x.Cascade, value));
 }
 private DynamicComponentPart(Type entity, string propertyName, AttributeStore underlyingStore)
     : base(underlyingStore, propertyName)
 {
     this.entity = entity;
     attributes  = new AttributeStore <DynamicComponentMapping>(underlyingStore);
     access      = new AccessStrategyBuilder <DynamicComponentPart <T> >(this, value => attributes.Set(x => x.Access, value));
 }
 public OneToOnePart(Type entity, Member property)
 {
     access        = new AccessStrategyBuilder <OneToOnePart <TOther> >(this, value => attributes.Set(x => x.Access, value));
     fetch         = new FetchTypeExpression <OneToOnePart <TOther> >(this, value => attributes.Set(x => x.Fetch, value));
     cascade       = new CascadeExpression <OneToOnePart <TOther> >(this, value => attributes.Set(x => x.Cascade, value));
     this.entity   = entity;
     this.property = property;
 }
 public HibernateMappingPart()
 {
     defaultCascade = new CascadeExpression <HibernateMappingPart>(this, value =>
     {
         var current = attributes.Get("DefaultCascade") as string;
         attributes.Set("DefaultCascade", Layer.UserSupplied, current == null ? value : string.Format("{0},{1}", current, value));
     });
     defaultAccess = new AccessStrategyBuilder <HibernateMappingPart>(this, value => attributes.Set("DefaultAccess", Layer.UserSupplied, value));
 }
 public ManyToOnePart(Type entity, Member property)
 {
     this.entity   = entity;
     this.property = property;
     access        = new AccessStrategyBuilder <ManyToOnePart <TOther> >(this, value => attributes.Set(x => x.Access, value));
     fetch         = new FetchTypeExpression <ManyToOnePart <TOther> >(this, value => attributes.Set(x => x.Fetch, value));
     cascade       = new CascadeExpression <ManyToOnePart <TOther> >(this, value => attributes.Set(x => x.Cascade, value));
     notFound      = new NotFoundExpression <ManyToOnePart <TOther> >(this, value => attributes.Set(x => x.NotFound, value));
 }
        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;
        }
Example #9
0
        public VersionPart(Type entity, Member member)
        {
            this.entity = entity;
            this.member = member;
            access      = new AccessStrategyBuilder <VersionPart>(this, value => attributes.Set("Access", Layer.UserSupplied, value));
            generated   = new VersionGeneratedBuilder <VersionPart>(this, value => attributes.Set("Generated", Layer.UserSupplied, value));

            SetDefaultAccess();
        }
Example #10
0
        public AnyPart(Type entity, Member member)
        {
            this.entity = entity;
            this.member = member;
            access      = new AccessStrategyBuilder <AnyPart <T> >(this, value => attributes.Set("Access", Layer.UserSupplied, value));
            cascade     = new CascadeExpression <AnyPart <T> >(this, value => attributes.Set("Cascade", Layer.UserSupplied, value));

            SetDefaultAccess();
        }
Example #11
0
        //PROTOTYPE1: ADDED

        public OneToOnePart(Type entity, Member member)
        {
            access      = new AccessStrategyBuilder <OneToOnePart <TOther> >(this, value => attributes.Set("Access", Layer.UserSupplied, value));
            fetch       = new FetchTypeExpression <OneToOnePart <TOther> >(this, value => attributes.Set("Fetch", Layer.UserSupplied, value));
            cascade     = new CascadeExpression <OneToOnePart <TOther> >(this, value => attributes.Set("Cascade", Layer.UserSupplied, value));
            this.entity = entity;
            this.member = member;

            SetDefaultAccess();
        }
Example #12
0
        public IdentityPart(Type entity, Type identityType)
        {
            this.entityType   = entity;
            this.identityType = identityType;

            access      = new AccessStrategyBuilder <IdentityPart>(this, value => attributes.Set("Access", Layer.UserSupplied, value));
            GeneratedBy = new IdentityGenerationStrategyBuilder <IdentityPart>(this, this.identityType, entity);

            SetDefaultGenerator();
        }
Example #13
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();
        }
        public IdentityPart(Type entity, Member member)
        {
            entityType   = entity;
            this.member  = member;
            identityType = member.PropertyType;

            access      = new AccessStrategyBuilder <IdentityPart>(this, value => attributes.Set(x => x.Access, value));
            GeneratedBy = new IdentityGenerationStrategyBuilder <IdentityPart>(this, member.PropertyType, entityType);
            SetName(member.Name);
            SetDefaultGenerator();
        }
Example #15
0
        public IdentityPart(Type entity, Member property)
        {
            this.property     = property;
            entityType        = entity;
            this.identityType = property.PropertyType;
            this.columnName   = property.Name;

            access      = new AccessStrategyBuilder <IdentityPart>(this, value => attributes.Set(x => x.Access, value));
            GeneratedBy = new IdentityGenerationStrategyBuilder <IdentityPart>(this, property.PropertyType, entity);

            SetDefaultGenerator();
        }
Example #16
0
        public IdentityPart(Type entity, Type identityType, string columnName)
        {
            this.property     = null;
            this.entityType   = entity;
            this.identityType = identityType;
            this.columnName   = columnName;

            access      = new AccessStrategyBuilder <IdentityPart>(this, value => attributes.Set(x => x.Access, value));
            GeneratedBy = new IdentityGenerationStrategyBuilder <IdentityPart>(this, this.identityType, entity);

            SetDefaultGenerator();
        }
        protected ComponentPartBase(AttributeStore attributes, Member member, MappingProviderStore providers)
            : base(providers)
        {
            this.attributes = attributes;
            access          = new AccessStrategyBuilder <TBuilder>((TBuilder)this, value => attributes.Set("Access", Layer.UserSupplied, value));
            this.member     = member;
            this.providers  = providers;

            if (member != null)
            {
                SetDefaultAccess();
            }
        }
Example #18
0
        public AnyPart(Type entity, Member member)
        {
            this.entity = entity;
            this.member = member;
            access      = new AccessStrategyBuilder <AnyPart <T> >(this, value => attributes.Set("Access", Layer.UserSupplied, value));
            cascade     = new CascadeExpression <AnyPart <T> >(this, value =>
            {
                var current = attributes.Get("Cascade") as string;
                attributes.Set("Cascade", Layer.UserSupplied, current == null ? value : string.Format("{0},{1}", current, value));
            });

            SetDefaultAccess();
        }
Example #19
0
        public ManyToOnePart(Type entity, Member member)
        {
            this.entity = entity;
            this.member = member;
            access      = new AccessStrategyBuilder <ManyToOnePart <TOther> >(this, value => attributes.Set("Access", Layer.UserSupplied, value));
            fetch       = new FetchTypeExpression <ManyToOnePart <TOther> >(this, value => attributes.Set("Fetch", Layer.UserSupplied, value));
            cascade     = new CascadeExpression <ManyToOnePart <TOther> >(this, value =>
            {
                var current = attributes.Get("Cascade") as string;
                attributes.Set("Cascade", Layer.UserSupplied, current == null ? value : string.Format("{0},{1}", current, value));
            });
            notFound = new NotFoundExpression <ManyToOnePart <TOther> >(this, value => attributes.Set("NotFound", Layer.UserSupplied, value));

            SetDefaultAccess();
        }
Example #20
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 #21
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 #22
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"
            });
        }
Example #23
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)));
        }
 public CompositeIdentityPart()
 {
     access = new AccessStrategyBuilder <CompositeIdentityPart <T> >(this, value => attributes.Set(x => x.Access, value));
 }
 public KeyManyToOnePart(KeyManyToOneMapping mapping)
 {
     this.mapping = mapping;
     Access       = new AccessStrategyBuilder <KeyManyToOnePart>(this, value => mapping.Set(x => x.Access, Layer.UserSupplied, value));
     NotFound     = new NotFoundExpression <KeyManyToOnePart>(this, value => mapping.Set(x => x.NotFound, Layer.UserSupplied, value));
 }
 public CompositeIdentityPart(Action <Member> onMemberMapped)
 {
     this.onMemberMapped = onMemberMapped;
     access = new AccessStrategyBuilder <CompositeIdentityPart <T> >(this, value => attributes.Set("Access", Layer.UserSupplied, value));
 }
Example #27
0
 public HibernateMappingPart()
 {
     defaultCascade = new CascadeExpression <HibernateMappingPart>(this, value => attributes.Set(x => x.DefaultCascade, value));
     defaultAccess  = new AccessStrategyBuilder <HibernateMappingPart>(this, value => attributes.Set(x => x.DefaultAccess, value));
 }
Example #28
0
 public KeyPropertyPart(KeyPropertyMapping mapping)
 {
     this.mapping = mapping;
     Access       = new AccessStrategyBuilder <KeyPropertyPart>(this, value => mapping.Set(x => x.Access, Layer.UserSupplied, value));
 }
 public KeyPropertyPart(KeyPropertyMapping mapping)
 {
     this.mapping = mapping;
     Access       = new AccessStrategyBuilder <KeyPropertyPart>(this, value => mapping.Access = value);
 }
 protected ComponentPartBase(AttributeStore underlyingStore, string propertyName)
 {
     attributes        = new AttributeStore <ComponentMappingBase>(underlyingStore);
     access            = new AccessStrategyBuilder <TBuilder>((TBuilder)this, value => attributes.Set(x => x.Access, value));
     this.propertyName = propertyName;
 }