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() ) ) {}
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; }
// 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() ) ) { }
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; }
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; } }
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; }
public void Polymorphism(PolymorphismType type) { classMapping.polymorphism = (HbmPolymorphismType)Enum.Parse(typeof(HbmPolymorphismType), type.ToString()); }
private bool IsExplicitPolymorphism(PolymorphismType type) { throw new NotImplementedException(); }