C# Class Azavea.Open.DAO.ClassMapping

Represents a mapping of a class onto a database table.
Datei anzeigen Open project: azavea/net-dao Class Usage Examples

Public Properties

Property Type Description
AllDataColsByObjAttrs string>.IDictionary
AllDataColsByObjMemberInfo string>.IDictionary
AllDataColsInOrder IList
AllObjAttrsByDataCol string>.IDictionary
AllObjMemberInfosByDataCol MemberInfo>.IDictionary
AllObjMemberInfosByObjAttr MemberInfo>.IDictionary
ClassType System.Type
Constructor System.Reflection.ConstructorInfo
DataColTypesByDataCol Type>.IDictionary
DataColTypesByObjAttr Type>.IDictionary
IdDataColsByObjAttrs string>.IDictionary
IdDataColsByObjMemberInfo string>.IDictionary
IdGeneratorsByDataCol GeneratorType>.IDictionary
IdSequencesByDataCol string>.IDictionary
NonIdDataColsByObjAttrs string>.IDictionary
NonIdDataColsByObjMemberInfo string>.IDictionary
Table string
TypeName string

Public Methods

Method Description
ClassMapping ( XmlNode hibConfNode ) : System

Construct it from an NHibernate config's "class" node. Will not include foreign keys by default.

ClassMapping ( XmlNode hibConfNode, bool reflect ) : System

Construct it from an NHibernate config's "class" node. This allows you to skip using reflection to populate the class info, if for example your Dao doesn't use it for some reason. Will not include foreign keys by default.

ClassMapping ( XmlNode hibConfNode, bool reflect, bool includeForeignKeys ) : System

Construct it from an NHibernate config's "class" node. This allows you to skip using reflection to populate the class info, if for example your Dao doesn't use it for some reason. This also allows you to specify whether to include many-to-one and one-to-one links as properties (may break FastDAO since the type of the attribute on the object will need to be the foreign key type (I.E. int) rather than the real object type of the relationship, which is what NHibernate expects).

ClassMapping ( string typeName, string tableName, IEnumerable colDefinitions ) : System

A constructor that allows you to explicitly declare the type, table name, and column mappings, without using an XML mapping string. (e.g. if you want to store mapping info in a database)

ClassMapping ( string typeName, string tableName, IEnumerable colDefinitions, bool reflect ) : System

A constructor that allows you to explicitly declare the type, table name, and column mappings, without using an XML mapping string. (e.g. if you want to store mapping info in a database)

ToString ( ) : string

Returns the class mapping type name and table name.

Private Methods

Method Description
ParseColumnType ( string input ) : Type
ParseNHibernateXML ( XmlNode hibConfNode, bool includeForeignKeys ) : void
ReflectOnTypeInfo ( ) : void

Method Details

ClassMapping() public method

Construct it from an NHibernate config's "class" node. Will not include foreign keys by default.
public ClassMapping ( XmlNode hibConfNode ) : System
hibConfNode System.Xml.XmlNode The XML configuration.
return System

ClassMapping() public method

Construct it from an NHibernate config's "class" node. This allows you to skip using reflection to populate the class info, if for example your Dao doesn't use it for some reason. Will not include foreign keys by default.
public ClassMapping ( XmlNode hibConfNode, bool reflect ) : System
hibConfNode System.Xml.XmlNode The XML configuration.
reflect bool Whether or not to use reflection to populate all the class info.
return System

ClassMapping() public method

Construct it from an NHibernate config's "class" node. This allows you to skip using reflection to populate the class info, if for example your Dao doesn't use it for some reason. This also allows you to specify whether to include many-to-one and one-to-one links as properties (may break FastDAO since the type of the attribute on the object will need to be the foreign key type (I.E. int) rather than the real object type of the relationship, which is what NHibernate expects).
public ClassMapping ( XmlNode hibConfNode, bool reflect, bool includeForeignKeys ) : System
hibConfNode System.Xml.XmlNode The XML configuration.
reflect bool Whether or not to use reflection to populate all the class info.
includeForeignKeys bool If true, many-to-one and one-to-one /// links will be included as properties.
return System

ClassMapping() public method

A constructor that allows you to explicitly declare the type, table name, and column mappings, without using an XML mapping string. (e.g. if you want to store mapping info in a database)
public ClassMapping ( string typeName, string tableName, IEnumerable colDefinitions ) : System
typeName string The fully-qualified Class,Assembly type name for the object.
tableName string The data source table name.
colDefinitions IEnumerable List of column mappings.
return System

ClassMapping() public method

A constructor that allows you to explicitly declare the type, table name, and column mappings, without using an XML mapping string. (e.g. if you want to store mapping info in a database)
public ClassMapping ( string typeName, string tableName, IEnumerable colDefinitions, bool reflect ) : System
typeName string The fully-qualified Class,Assembly type name for the object.
tableName string The data source table name.
colDefinitions IEnumerable List of column mappings.
reflect bool Whether or not to use reflection to populate all the class info.
return System

ToString() public method

Returns the class mapping type name and table name.
public ToString ( ) : string
return string

Property Details

AllDataColsByObjAttrs public_oe property

IDCols + PropertyCols together. Key: Class Property/Attribute Name Value: DB Column name
public IDictionary AllDataColsByObjAttrs
return string>.IDictionary

AllDataColsByObjMemberInfo public_oe property

IDCols + PropertyCols together. Key: Class Property/Attribute MemberInfo Value: DB Column name
public IDictionary AllDataColsByObjMemberInfo
return string>.IDictionary

AllDataColsInOrder public_oe property

The DB column names in the order they appeared in the mapping file.
public IList AllDataColsInOrder
return IList

AllObjAttrsByDataCol public_oe property

The class attribute names keyed by the column name (case insensitive since column names read from the data source may or may not be in the expected case). Key: DB Column name Value: Class Property/Attribute Name
public IDictionary AllObjAttrsByDataCol
return string>.IDictionary

AllObjMemberInfosByDataCol public_oe property

The MemberInfos keyed by the column name (case insensitive since column names read from the data source may or may not be in the expected case). Key: DB Column name Value: Class Property/Attribute MemberInfo
public IDictionary AllObjMemberInfosByDataCol
return MemberInfo>.IDictionary

AllObjMemberInfosByObjAttr public_oe property

The MemberInfos keyed by the column name. Key: Class Property/Attribute Name Value: Class Property/Attribute MemberInfo
public IDictionary AllObjMemberInfosByObjAttr
return MemberInfo>.IDictionary

ClassType public_oe property

The class that is being mapped.
public Type,System ClassType
return System.Type

Constructor public_oe property

The constructor that takes no parameters.
public ConstructorInfo,System.Reflection Constructor
return System.Reflection.ConstructorInfo

DataColTypesByDataCol public_oe property

Column types, if specified in the mapping file. Key: Column name (case insensitive since column names read from the data source may or may not be in the expected case) Value: Type string from the mapping file, or null if none was specified.
public IDictionary DataColTypesByDataCol
return Type>.IDictionary

DataColTypesByObjAttr public_oe property

Column types, if specified in the mapping file. Key: Class Property/Attribute Name Value: Type string from the mapping file, or null if none was specified.
public IDictionary DataColTypesByObjAttr
return Type>.IDictionary

IdDataColsByObjAttrs public_oe property

The columns that comprise the ID. Key: Class Property/Attribute Value: DB Column
public IDictionary IdDataColsByObjAttrs
return string>.IDictionary

IdDataColsByObjMemberInfo public_oe property

The columns that comprise the ID. Key: Class Property/Attribute MemberInfo Value: DB Column name
public IDictionary IdDataColsByObjMemberInfo
return string>.IDictionary

IdGeneratorsByDataCol public_oe property

For each ID column, what type of generator do we use (case insensitive since column names read from the data source may or may not be in the expected case). Key: Column name Value: Generator type.
public IDictionary IdGeneratorsByDataCol
return GeneratorType>.IDictionary

IdSequencesByDataCol public_oe property

For each ID column, what sequence (if any) do we use. Only populated for IDs with GeneratorType SEQUENCE. Key: Column name (case insensitive since column names read from the data source may or may not be in the expected case) Value: Sequence name.
public IDictionary IdSequencesByDataCol
return string>.IDictionary

NonIdDataColsByObjAttrs public_oe property

All the columns that aren't part of the ID. Key: Class Property/Attribute Value: DB Column name
public IDictionary NonIdDataColsByObjAttrs
return string>.IDictionary

NonIdDataColsByObjMemberInfo public_oe property

All the columns that aren't part of the ID. Key: Class Property/Attribute MemberInfo Value: DB Column name
public IDictionary NonIdDataColsByObjMemberInfo
return string>.IDictionary

Table public_oe property

The table it is being mapped to.
public string Table
return string

TypeName public_oe property

The class name that is being mapped.
public string TypeName
return string