C# 클래스 NHibernate.Type.TypeFactory

Used internally to obtain instances of IType.
Applications should use static methods and constants on NHibernate.NHibernateUtil if the default IType is good enough. For example, the TypeFactory should only be used when the String needs to have a length of 300 instead of 255. At this point NHibernateUtil.String does not get you the correct IType. Instead use TypeFactory.GetString(300) and keep a local variable that holds a reference to the IType.
파일 보기 프로젝트 열기: nhibernate/nhibernate-core 1 사용 예제들

공개 메소드들

메소드 설명
Array ( string role, string propertyRef, bool embedded, System elementClass ) : NHibernate.Type.CollectionType
Basic ( string name ) : IType

Given the name of a Hibernate type such as Decimal, Decimal(19,0) , Int32, or even NHibernate.Type.DecimalType, NHibernate.Type.DecimalType(19,0), NHibernate.Type.Int32Type, then return an instance of NHibernate.Type.IType

This method will return null if the name is not found in the basicNameMap.

CustomCollection ( string typeName, string>.IDictionary typeParameters, string role, string propertyRef, bool embedded ) : NHibernate.Type.CollectionType
GenericBag ( string role, string propertyRef, System elementClass ) : NHibernate.Type.CollectionType
GenericIdBag ( string role, string propertyRef, System elementClass ) : NHibernate.Type.CollectionType
GenericList ( string role, string propertyRef, System elementClass ) : NHibernate.Type.CollectionType
GenericMap ( string role, string propertyRef, System indexClass, System elementClass ) : NHibernate.Type.CollectionType
GenericOrderedSet ( string role, string propertyRef, System elementClass ) : NHibernate.Type.CollectionType
GenericSet ( string role, string propertyRef, System elementClass ) : NHibernate.Type.CollectionType
GenericSortedDictionary ( string role, string propertyRef, object comparer, System indexClass, System elementClass ) : NHibernate.Type.CollectionType
GenericSortedList ( string role, string propertyRef, object comparer, System indexClass, System elementClass ) : NHibernate.Type.CollectionType
GenericSortedSet ( string role, string propertyRef, object comparer, System elementClass ) : NHibernate.Type.CollectionType
HeuristicType ( string typeName ) : IType

Uses heuristics to deduce a NHibernate type given a string naming the type.

When looking for the NHibernate type it will look in the cache of the Basic types first. If it doesn't find it in the cache then it uses the typeName to get a reference to the Class (Type in .NET). Once we get the reference to the .NET class we check to see if it implements IType, ICompositeUserType, IUserType, ILifecycle (Association), or IPersistentEnum. If none of those are implemented then we will serialize the Type to the database using NHibernate.Type.SerializableType(typeName)

HeuristicType ( string typeName, string>.IDictionary parameters ) : IType

Uses heuristics to deduce a NHibernate type given a string naming the type.

HeuristicType ( string typeName, string>.IDictionary parameters, int length ) : IType

Uses heuristics to deduce a NHibernate type given a string naming the type.

InjectParameters ( Object type, string>.IDictionary parameters ) : void
ManyToOne ( string persistentClass ) : EntityType

A many-to-one association type for the given class and cascade style.

ManyToOne ( string persistentClass, bool lazy ) : EntityType

A many-to-one association type for the given class and cascade style.

ManyToOne ( string persistentClass, string uniqueKeyPropertyName, bool lazy, bool unwrapProxy, bool isEmbeddedInXML, bool ignoreNotFound, bool isLogicalOneToOne ) : EntityType

A many-to-one association type for the given class and cascade style.

OneToOne ( string persistentClass, ForeignKeyDirection foreignKeyType, string uniqueKeyPropertyName, bool lazy, bool unwrapProxy, bool isEmbeddedInXML, string entityName, string propertyName ) : EntityType

A one-to-one association type for the given class and cascade style.

비공개 메소드들

메소드 설명
AddToTypeOfName ( string key, IType type ) : void
AddToTypeOfNameWithLength ( string key, IType type ) : void
AddToTypeOfNameWithPrecision ( string key, IType type ) : void
BuiltInType ( string typeName, byte precision, byte scale ) : IType
BuiltInType ( string typeName, int length ) : IType
GetAnsiStringType ( int length ) : NullableType
GetBinaryType ( int length ) : NullableType
GetClrTypeAliases ( System systemType ) : IEnumerable
GetKeyForLengthBased ( string name, int length ) : string
GetKeyForPrecisionScaleBased ( string name, byte precision, byte scale ) : string
GetSerializableType ( System serializableType ) : NullableType
GetSerializableType ( System serializableType, int length ) : NullableType
GetSerializableType ( int length ) : NullableType
GetStringType ( int length ) : NullableType
GetType ( NullableType defaultUnqualifiedType, byte precision, byte scale, NullableTypeCreatorDelegate ctor ) : NullableType
GetType ( NullableType defaultUnqualifiedType, int length, GetNullableTypeWithLength ctorDelegate ) : NullableType
GetTypeClassification ( string typeName ) : TypeClassification

Gets the classification of the Type based on the string.

This parses through the string and makes the assumption that no class name and no assembly name will contain the "(".

If it finds the "(" and then finds a "," afterwards then it is a TypeClassification.PrecisionScale.

If it finds the "(" and doesn't find a "," afterwards, then it is a TypeClassification.Length.

If it doesn't find the "(" then it assumes that it is a TypeClassification.Plain.

GetTypeType ( int length ) : NullableType
RegisterBuiltInTypes ( ) : void

Register other NO Default .NET type

These type will be used only when the "type" attribute was is specified in the mapping. These are in here because needed to NO override default CLR types and be available in mappings

RegisterDefaultNetTypes ( ) : void

Register other Default .NET type

These type will be used, as default, even when the "type" attribute was NOT specified in the mapping

RegisterType ( IType nhibernateType, IEnumerable aliases ) : void
RegisterType ( IType nhibernateType, IEnumerable aliases, GetNullableTypeWithLength ctorLength ) : void
RegisterType ( IType nhibernateType, IEnumerable aliases, GetNullableTypeWithPrecision ctorPrecision ) : void
RegisterType ( System systemType, IType nhibernateType, IEnumerable aliases ) : void
RegisterType ( System systemType, IType nhibernateType, IEnumerable aliases, GetNullableTypeWithLength ctorLength ) : void
RegisterType ( System systemType, IType nhibernateType, IEnumerable aliases, GetNullableTypeWithPrecision ctorPrecision ) : void
TypeFactory ( ) : System

메소드 상세

Array() 공개 정적인 메소드

public static Array ( string role, string propertyRef, bool embedded, System elementClass ) : NHibernate.Type.CollectionType
role string
propertyRef string
embedded bool
elementClass System
리턴 NHibernate.Type.CollectionType

Basic() 공개 정적인 메소드

Given the name of a Hibernate type such as Decimal, Decimal(19,0) , Int32, or even NHibernate.Type.DecimalType, NHibernate.Type.DecimalType(19,0), NHibernate.Type.Int32Type, then return an instance of NHibernate.Type.IType
This method will return null if the name is not found in the basicNameMap.
public static Basic ( string name ) : IType
name string The name of the type.
리턴 IType

CustomCollection() 공개 정적인 메소드

public static CustomCollection ( string typeName, string>.IDictionary typeParameters, string role, string propertyRef, bool embedded ) : NHibernate.Type.CollectionType
typeName string
typeParameters string>.IDictionary
role string
propertyRef string
embedded bool
리턴 NHibernate.Type.CollectionType

GenericBag() 공개 정적인 메소드

public static GenericBag ( string role, string propertyRef, System elementClass ) : NHibernate.Type.CollectionType
role string
propertyRef string
elementClass System
리턴 NHibernate.Type.CollectionType

GenericIdBag() 공개 정적인 메소드

public static GenericIdBag ( string role, string propertyRef, System elementClass ) : NHibernate.Type.CollectionType
role string
propertyRef string
elementClass System
리턴 NHibernate.Type.CollectionType

GenericList() 공개 정적인 메소드

public static GenericList ( string role, string propertyRef, System elementClass ) : NHibernate.Type.CollectionType
role string
propertyRef string
elementClass System
리턴 NHibernate.Type.CollectionType

GenericMap() 공개 정적인 메소드

public static GenericMap ( string role, string propertyRef, System indexClass, System elementClass ) : NHibernate.Type.CollectionType
role string
propertyRef string
indexClass System
elementClass System
리턴 NHibernate.Type.CollectionType

GenericOrderedSet() 공개 정적인 메소드

public static GenericOrderedSet ( string role, string propertyRef, System elementClass ) : NHibernate.Type.CollectionType
role string
propertyRef string
elementClass System
리턴 NHibernate.Type.CollectionType

GenericSet() 공개 정적인 메소드

public static GenericSet ( string role, string propertyRef, System elementClass ) : NHibernate.Type.CollectionType
role string
propertyRef string
elementClass System
리턴 NHibernate.Type.CollectionType

GenericSortedDictionary() 공개 정적인 메소드

public static GenericSortedDictionary ( string role, string propertyRef, object comparer, System indexClass, System elementClass ) : NHibernate.Type.CollectionType
role string
propertyRef string
comparer object
indexClass System
elementClass System
리턴 NHibernate.Type.CollectionType

GenericSortedList() 공개 정적인 메소드

public static GenericSortedList ( string role, string propertyRef, object comparer, System indexClass, System elementClass ) : NHibernate.Type.CollectionType
role string
propertyRef string
comparer object
indexClass System
elementClass System
리턴 NHibernate.Type.CollectionType

GenericSortedSet() 공개 정적인 메소드

public static GenericSortedSet ( string role, string propertyRef, object comparer, System elementClass ) : NHibernate.Type.CollectionType
role string
propertyRef string
comparer object
elementClass System
리턴 NHibernate.Type.CollectionType

HeuristicType() 공개 정적인 메소드

Uses heuristics to deduce a NHibernate type given a string naming the type.
When looking for the NHibernate type it will look in the cache of the Basic types first. If it doesn't find it in the cache then it uses the typeName to get a reference to the Class (Type in .NET). Once we get the reference to the .NET class we check to see if it implements IType, ICompositeUserType, IUserType, ILifecycle (Association), or IPersistentEnum. If none of those are implemented then we will serialize the Type to the database using NHibernate.Type.SerializableType(typeName)
public static HeuristicType ( string typeName ) : IType
typeName string
리턴 IType

HeuristicType() 공개 정적인 메소드

Uses heuristics to deduce a NHibernate type given a string naming the type.
public static HeuristicType ( string typeName, string>.IDictionary parameters ) : IType
typeName string the type name
parameters string>.IDictionary parameters for the type
리턴 IType

HeuristicType() 공개 정적인 메소드

Uses heuristics to deduce a NHibernate type given a string naming the type.
public static HeuristicType ( string typeName, string>.IDictionary parameters, int length ) : IType
typeName string the type name
parameters string>.IDictionary parameters for the type
length int optionally, the size of the type
리턴 IType

InjectParameters() 공개 정적인 메소드

public static InjectParameters ( Object type, string>.IDictionary parameters ) : void
type Object
parameters string>.IDictionary
리턴 void

ManyToOne() 공개 정적인 메소드

A many-to-one association type for the given class and cascade style.
public static ManyToOne ( string persistentClass ) : EntityType
persistentClass string
리턴 EntityType

ManyToOne() 공개 정적인 메소드

A many-to-one association type for the given class and cascade style.
public static ManyToOne ( string persistentClass, bool lazy ) : EntityType
persistentClass string
lazy bool
리턴 EntityType

ManyToOne() 공개 정적인 메소드

A many-to-one association type for the given class and cascade style.
public static ManyToOne ( string persistentClass, string uniqueKeyPropertyName, bool lazy, bool unwrapProxy, bool isEmbeddedInXML, bool ignoreNotFound, bool isLogicalOneToOne ) : EntityType
persistentClass string
uniqueKeyPropertyName string
lazy bool
unwrapProxy bool
isEmbeddedInXML bool
ignoreNotFound bool
isLogicalOneToOne bool
리턴 EntityType

OneToOne() 공개 정적인 메소드

A one-to-one association type for the given class and cascade style.
public static OneToOne ( string persistentClass, ForeignKeyDirection foreignKeyType, string uniqueKeyPropertyName, bool lazy, bool unwrapProxy, bool isEmbeddedInXML, string entityName, string propertyName ) : EntityType
persistentClass string
foreignKeyType ForeignKeyDirection
uniqueKeyPropertyName string
lazy bool
unwrapProxy bool
isEmbeddedInXML bool
entityName string
propertyName string
리턴 EntityType