private Domain BuildDomain(InheritanceSchema schema) { var configuration = DomainConfigurationFactory.Create(); configuration.Types.Register(typeof(ParentEntity).Assembly, typeof(ParentEntity).Namespace); configuration.Types.Register(typeof(ClassTableSchemaModifier)); configuration.Types.Register(typeof(SingleTableSchemaModifier)); configuration.Types.Register(typeof(SingleTableSchemaModifier)); InheritanceSchemaModifier.ActivateModifier(schema); return(Domain.Build(configuration)); }
// Constructors /// <summary> /// Initializes a new instance of this class. /// </summary> /// <param name="root">The hierarchy root.</param> /// <param name="key">The key info.</param> /// <param name="inheritanceSchema">The inheritance schema.</param> /// <param name="typeDiscriminatorMap">The type discriminator map.</param> public HierarchyInfo( TypeInfo root, KeyInfo key, InheritanceSchema inheritanceSchema, TypeDiscriminatorMap typeDiscriminatorMap) { Root = root; Key = key; InheritanceSchema = inheritanceSchema; TypeDiscriminatorMap = typeDiscriminatorMap; }
public IdsStruct(InheritanceSchema inheritanceSchema, long baseEntityId, long firstSuccessorId, long secondSuccessorId, long secondSuccessorLeafId, long thirdSuccessorId, long thirdSuccessorLeaf1Id, long thirdSuccessorLeaf2Id) : this() { InheritanceSchema = inheritanceSchema; BaseEntityId = baseEntityId; FirstSuccessorId = firstSuccessorId; SecondSuccessorId = secondSuccessorId; SecondSuccessorLeafId = secondSuccessorLeafId; ThirdSuccessorId = thirdSuccessorId; ThirdSuccessorLeaf1Id = thirdSuccessorLeaf1Id; ThirdSuccessorLeaf2Id = thirdSuccessorLeaf2Id; }
public static void ActivateModifier(InheritanceSchema schema) { DeactivateModifiers(); switch (schema) { case InheritanceSchema.ConcreteTable: ConcreteTableSchemaModifier.IsEnabled = true; break; case InheritanceSchema.SingleTable: SingleTableSchemaModifier.IsEnabled = true; break; default: ClassTableSchemaModifier.IsEnabled = true; break; } }
// Constructors protected InheritanceSchemaModifier(InheritanceSchema schema) { Schema = schema; }
/// <summary> /// Initializes a new instance of this class. /// </summary> /// <param name="schema">The inheritance schema for the hierarchy.</param> public HierarchyRootAttribute(InheritanceSchema schema) { InheritanceSchema = schema; Clustered = true; }