C# Класс Castle.ActiveRecord.Framework.Internal.SemanticVerifierVisitor

Traverse the tree checking the semantics of the relation and association. The goal is to raise clear exceptions with tips of how to fix any error. It also tries to infer as much information from the class / attribute model as possible so it can complete the missing information without the user needing to specify it.
Наследование: AbstractDepthFirstVisitor
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
GetIndexTypeFromDictionary ( Type propertyType ) : Type

Gets the index type of a mapped dictionary.

GetMapTypeFromDictionary ( Type propertyType ) : Type

Gets the index type of a mapped dictionary.

SemanticVerifierVisitor ( ActiveRecordModelCollection arCollection ) : System

Initializes a new instance of the SemanticVerifierVisitor class.

VisitAny ( AnyModel model ) : void

Visits any.

VisitBelongsTo ( BelongsToModel model ) : void

Visits the belongs to.

Infer column name and type Verify that the property is virtual if the class was marked lazy.

VisitCompositePrimaryKey ( CompositeKeyModel model ) : void

Visits the composite primary key.

Validate that the composite key type is implementing GetHashCode() and Equals(), is mark serializable. Validate that the compose key is compose of two or more columns

VisitCompositeUserType ( CompositeUserTypeModel model ) : void

Visits the custom composite user type.

Apply any column prefixes specified

VisitField ( FieldModel model ) : void

Visits the field.

Infer column name and nullablity

VisitHasAndBelongsToMany ( HasAndBelongsToManyModel model ) : void

Visits the has and belongs to many.

Verify that a link table was specified Verify that a key was specified and that it is valid Verify that required information was specified

VisitHasMany ( HasManyModel model ) : void

Visits the has many.

Guess the type of the relation, if not specified explicitly Verify that the assoication is valid on [HasMany] Validate that required information is specified Infer the other side of the assoication and grab require data from it

VisitHasManyToAny ( HasManyToAnyModel model ) : void

Visit the has many to any

VisitKey ( KeyModel model ) : void

Visits the key.

Infer column name

VisitModel ( ActiveRecordModel model ) : void

Visits the model.

Check that the model: - Define only a discriminator or a join subclass, not both - Doesn't specify version/timestamp property on a joined subclass / discriminator subclass - Validate that the custom entity persister implements IEntityPersister - Validate the joined subclasses has a [JoinedKey] to map back to the parent table - Validate that the class has a PK

VisitNested ( Castle.ActiveRecord.Framework.Internal.NestedModel model ) : void

Visits the nested model

Infer the column name and applies and column prefixes specified

VisitOneToOne ( Castle.ActiveRecord.Framework.Internal.OneToOneModel model ) : void

Visits the one to one.

Infer the type on the other side

VisitPrimaryKey ( PrimaryKeyModel model ) : void

Visits the primary key.

Infer column name and the reverse property if using [OneToOne]

VisitProperty ( PropertyModel model ) : void

Visits the property.

Infer column name and whatever this propery can be null or not Also catch common mistake of try to use [Property] on an entity, instead of [BelongsTo]

VisitTimestamp ( TimestampModel model ) : void

Visits the timestamp.

Infer column name

VisitVersion ( VersionModel model ) : void

Visits the version.

Infer column name

Приватные методы

Метод Описание
AssertHasValidKey ( ActiveRecordModel model ) : void
GuessRelation ( PropertyInfo property, RelationType type ) : RelationType
ObtainNullableTypeNameForCLRNullable ( Type type ) : String

Описание методов

GetIndexTypeFromDictionary() публичный статический Метод

Gets the index type of a mapped dictionary.
public static GetIndexTypeFromDictionary ( Type propertyType ) : Type
propertyType System.Type Type of the property.
Результат System.Type

GetMapTypeFromDictionary() публичный статический Метод

Gets the index type of a mapped dictionary.
public static GetMapTypeFromDictionary ( Type propertyType ) : Type
propertyType System.Type Type of the property.
Результат System.Type

SemanticVerifierVisitor() публичный Метод

Initializes a new instance of the SemanticVerifierVisitor class.
public SemanticVerifierVisitor ( ActiveRecordModelCollection arCollection ) : System
arCollection ActiveRecordModelCollection The ar collection.
Результат System

VisitAny() публичный Метод

Visits any.
public VisitAny ( AnyModel model ) : void
model AnyModel The model.
Результат void

VisitBelongsTo() публичный Метод

Visits the belongs to.
Infer column name and type Verify that the property is virtual if the class was marked lazy.
public VisitBelongsTo ( BelongsToModel model ) : void
model BelongsToModel The model.
Результат void

VisitCompositePrimaryKey() публичный Метод

Visits the composite primary key.
Validate that the composite key type is implementing GetHashCode() and Equals(), is mark serializable. Validate that the compose key is compose of two or more columns
public VisitCompositePrimaryKey ( CompositeKeyModel model ) : void
model CompositeKeyModel The model.
Результат void

VisitCompositeUserType() публичный Метод

Visits the custom composite user type.
Apply any column prefixes specified
public VisitCompositeUserType ( CompositeUserTypeModel model ) : void
model CompositeUserTypeModel The model.
Результат void

VisitField() публичный Метод

Visits the field.
Infer column name and nullablity
public VisitField ( FieldModel model ) : void
model FieldModel The model.
Результат void

VisitHasAndBelongsToMany() публичный Метод

Visits the has and belongs to many.
Verify that a link table was specified Verify that a key was specified and that it is valid Verify that required information was specified
public VisitHasAndBelongsToMany ( HasAndBelongsToManyModel model ) : void
model HasAndBelongsToManyModel The model.
Результат void

VisitHasMany() публичный Метод

Visits the has many.
Guess the type of the relation, if not specified explicitly Verify that the assoication is valid on [HasMany] Validate that required information is specified Infer the other side of the assoication and grab require data from it
public VisitHasMany ( HasManyModel model ) : void
model HasManyModel The model.
Результат void

VisitHasManyToAny() публичный Метод

Visit the has many to any
public VisitHasManyToAny ( HasManyToAnyModel model ) : void
model HasManyToAnyModel The model.
Результат void

VisitKey() публичный Метод

Visits the key.
Infer column name
public VisitKey ( KeyModel model ) : void
model KeyModel The model.
Результат void

VisitModel() публичный Метод

Visits the model.
Check that the model: - Define only a discriminator or a join subclass, not both - Doesn't specify version/timestamp property on a joined subclass / discriminator subclass - Validate that the custom entity persister implements IEntityPersister - Validate the joined subclasses has a [JoinedKey] to map back to the parent table - Validate that the class has a PK
public VisitModel ( ActiveRecordModel model ) : void
model ActiveRecordModel The model.
Результат void

VisitNested() публичный Метод

Visits the nested model
Infer the column name and applies and column prefixes specified
public VisitNested ( Castle.ActiveRecord.Framework.Internal.NestedModel model ) : void
model Castle.ActiveRecord.Framework.Internal.NestedModel The model.
Результат void

VisitOneToOne() публичный Метод

Visits the one to one.
Infer the type on the other side
public VisitOneToOne ( Castle.ActiveRecord.Framework.Internal.OneToOneModel model ) : void
model Castle.ActiveRecord.Framework.Internal.OneToOneModel The model.
Результат void

VisitPrimaryKey() публичный Метод

Visits the primary key.
Infer column name and the reverse property if using [OneToOne]
public VisitPrimaryKey ( PrimaryKeyModel model ) : void
model PrimaryKeyModel The model.
Результат void

VisitProperty() публичный Метод

Visits the property.
Infer column name and whatever this propery can be null or not Also catch common mistake of try to use [Property] on an entity, instead of [BelongsTo]
public VisitProperty ( PropertyModel model ) : void
model PropertyModel The model.
Результат void

VisitTimestamp() публичный Метод

Visits the timestamp.
Infer column name
public VisitTimestamp ( TimestampModel model ) : void
model TimestampModel The model.
Результат void

VisitVersion() публичный Метод

Visits the version.
Infer column name
public VisitVersion ( VersionModel model ) : void
model VersionModel The model.
Результат void