public static bool Convert(PolymorphismType type)
		{
			switch (type)
			{
				case PolymorphismType.Explicit:
					return true;
				case PolymorphismType.Implicit:
					return true;
				default:
					throw new AnnotationException("Unknown polymorphism type");
			}
		}
		// Aggregate
		private PolymorphismSchema(
			Type targetType,
			PolymorphismType polymorphismType,
			PolymorphismSchemaChildrenType childrenType,
			params PolymorphismSchema[] childItemSchemaList )
			: this(
				targetType,
				polymorphismType,
				new ReadOnlyDictionary<string, Type>( EmptyMap ),
				childrenType,
				new ReadOnlyCollection<PolymorphismSchema>(
					( childItemSchemaList ?? EmptyChildren ).Select( x => x ?? Default ).ToArray()
				) 
			) {}
Esempio n. 3
0
        public static bool Convert(PolymorphismType type)
        {
            switch (type)
            {
            case PolymorphismType.Explicit:
                return(true);

            case PolymorphismType.Implicit:
                return(true);

            default:
                throw new AnnotationException("Unknown polymorphism type");
            }
        }
 // Aggregate
 private PolymorphismSchema(
     Type targetType,
     PolymorphismType polymorphismType,
     PolymorphismSchemaChildrenType childrenType,
     params PolymorphismSchema[] childItemSchemaList)
     : this(
         targetType,
         polymorphismType,
         new ReadOnlyDictionary <byte, Type>(EmptyMap),
         childrenType,
         new ReadOnlyCollection <PolymorphismSchema>(
             (childItemSchemaList ?? EmptyChildren).Select(x => x ?? Default).ToArray()
             )
         )
 {
 }
		private PolymorphismSchema(
			Type targetType,
			PolymorphismType polymorphismType,
			IDictionary<string, Type> codeTypeMapping,
			Func<PolymorphicTypeVerificationContext, bool> typeVerifier,
			PolymorphismSchemaChildrenType childrenType,
			params PolymorphismSchema[] childItemSchemaList
		)
			: this(
				targetType,
				polymorphismType,
				new ReadOnlyDictionary<string, Type>( codeTypeMapping ),
				typeVerifier,
				childrenType,
				new ReadOnlyCollection<PolymorphismSchema>(
					( childItemSchemaList ?? EmptyChildren ).Select( x => x ?? Default ).ToArray()
				)
			) {}
        private PolymorphismSchema(
            Type targetType,
            PolymorphismType polymorphismType,
            ReadOnlyDictionary <byte, Type> codeTypeMapping,
            PolymorphismSchemaChildrenType childrenType,
            ReadOnlyCollection <PolymorphismSchema> childItemSchemaList)
        {
            if (targetType == null)
            {
                throw new ArgumentNullException("targetType");
            }

            this.TargetType       = targetType;
            this.PolymorphismType = polymorphismType;
            this._codeTypeMapping = codeTypeMapping;
            this.ChildrenType     = childrenType;
            this._children        = childItemSchemaList;
        }
		private PolymorphismSchema(
			Type targetType,
			PolymorphismType polymorphismType,
			ReadOnlyDictionary<byte, Type> codeTypeMapping,
			PolymorphismSchemaChildrenType childrenType,
			ReadOnlyCollection<PolymorphismSchema> childItemSchemaList )
		{
			if ( targetType == null )
			{
				throw new ArgumentNullException( "targetType" );
			}

			this.TargetType = targetType;
			this.PolymorphismType = polymorphismType;
			this._codeTypeMapping = codeTypeMapping;
			this.ChildrenType = childrenType;
			this._children = childItemSchemaList;
		}
Esempio n. 8
0
 // Aggregate
 private PolymorphismSchema(
     Type targetType,
     PolymorphismType polymorphismType,
     Func <PolymorphicTypeVerificationContext, bool> typeVerifier,
     PolymorphismSchemaChildrenType childrenType,
     params PolymorphismSchema[] childItemSchemaList
     )
     : this(
         targetType,
         polymorphismType,
         new ReadOnlyDictionary <string, Type>(EmptyMap),
         typeVerifier,
         childrenType,
         new ReadOnlyCollection <PolymorphismSchema>(
             (childItemSchemaList ?? EmptyChildren).Select(x => x ?? Default).ToArray()
             )
         )
 {
 }
Esempio n. 9
0
        private PolymorphismSchema(
            Type targetType,
            PolymorphismType polymorphismType,
            ReadOnlyDictionary <string, Type> codeTypeMapping,
            Func <PolymorphicTypeVerificationContext, bool> typeVerifier,
            PolymorphismSchemaChildrenType childrenType,
            ReadOnlyCollection <PolymorphismSchema> childItemSchemaList
            )
        {
            if (targetType == null)
            {
                throw new ArgumentNullException("targetType");
            }

            this.TargetType       = targetType;
            this.PolymorphismType = polymorphismType;
            this._codeTypeMapping = codeTypeMapping;
            this.ChildrenType     = childrenType;
            this._children        = childItemSchemaList;
            this.TypeVerifier     = typeVerifier ?? DefaultTypeVerfiier;
        }
Esempio n. 10
0
		private void BindHibernateAnnotation(EntityAttribute hibAnn)
		{
			if (hibAnn != null)
			{
				dynamicInsert = hibAnn.IsDynamicInsert;
				dynamicUpdate = hibAnn.IsDynamicUpdate;
				optimisticLockType = hibAnn.OptimisticLock;
				selectBeforeUpdate = hibAnn.IsSelectBeforeUpdate;
				polymorphismType = hibAnn.Polymorphism;
				explicitHibernateEntityAnnotation = true;
				//persister handled in bind
			}
			else
			{
				//default values when the annotation is not there
				dynamicInsert = false;
				dynamicUpdate = false;
				optimisticLockType = OptimisticLockType.Version;
				polymorphismType = PolymorphismType.Implicit;
				selectBeforeUpdate = false;
			}
		}
Esempio n. 11
0
 private void BindHibernateAnnotation(EntityAttribute hibAnn)
 {
     if (hibAnn != null)
     {
         dynamicInsert      = hibAnn.IsDynamicInsert;
         dynamicUpdate      = hibAnn.IsDynamicUpdate;
         optimisticLockType = hibAnn.OptimisticLock;
         selectBeforeUpdate = hibAnn.IsSelectBeforeUpdate;
         polymorphismType   = hibAnn.Polymorphism;
         explicitHibernateEntityAnnotation = true;
         //persister handled in bind
     }
     else
     {
         //default values when the annotation is not there
         dynamicInsert      = false;
         dynamicUpdate      = false;
         optimisticLockType = OptimisticLockType.Version;
         polymorphismType   = PolymorphismType.Implicit;
         selectBeforeUpdate = false;
     }
 }
Esempio n. 12
0
 public void Polymorphism(PolymorphismType type)
 {
     CustomizersHolder.AddCustomizer(typeof(TEntity), (IClassMapper m) => m.Polymorphism(type));
 }
		private PolymorphismSchema(
			Type targetType,
			PolymorphismType polymorphismType,
			ReadOnlyDictionary<string, Type> codeTypeMapping,
			Func<PolymorphicTypeVerificationContext, bool> typeVerifier,
			PolymorphismSchemaChildrenType childrenType,
			ReadOnlyCollection<PolymorphismSchema> childItemSchemaList
		)
		{
			if ( targetType == null )
			{
				throw new ArgumentNullException( "targetType" );
			}

			this.TargetType = targetType;
			this.PolymorphismType = polymorphismType;
			this._codeTypeMapping = codeTypeMapping;
			this.ChildrenType = childrenType;
			this._children = childItemSchemaList;
			this.TypeVerifier = typeVerifier ?? DefaultTypeVerfiier;
		}
Esempio n. 14
0
 public void Polymorphism(PolymorphismType type)
 {
     classMapping.polymorphism = (HbmPolymorphismType)Enum.Parse(typeof(HbmPolymorphismType), type.ToString());
 }
Esempio n. 15
0
		private bool IsExplicitPolymorphism(PolymorphismType type)
		{
			throw new NotImplementedException();
		}
Esempio n. 16
0
 private bool IsExplicitPolymorphism(PolymorphismType type)
 {
     throw new NotImplementedException();
 }