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
파일 보기 프로젝트 열기: nats/castle-1.0.3-mono 1 사용 예제들

공개 메소드들

메소드 설명
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