ActiveRecordAttribute API Document
Associate meta information related to the desired table mapping.
Quick Note
If no table is specified, the class name is used as table name
Example
[ActiveRecord("tb_Order")] public class Order : ActiveRecordBase { }
Constructors
ActiveRecordAttribute()
Uses the class name as table name
ActiveRecordAttribute(String table)
Associates the specified table with the target type
| Parameter | Description |
|---|---|
| table |
ActiveRecordAttribute(String table, String schema)
Associates the specified table and schema with the target type
| Parameter | Description |
|---|---|
| table | Missing documentation |
| schema | Missing documentation |
Properties
| Name | Type | Description |
|---|---|---|
| Table | String | Gets or sets the table name associated with the type |
| Schema | String | Gets or sets the schema name associated with the type |
| Proxy | Type | Associates a proxy type with the target type |
| DiscriminatorColumn | String | Gets or sets the Discriminator column for a table inheritance modeling |
| DiscriminatorType | String | Gets or sets the column type (like string or integer) for the discriminator column |
| DiscriminatorValue | String | Gets or sets the value that represents the target class on the discriminator column |
| Where | String | SQL condition to retrieve objects |
| Lazy | Boolean | Enable lazy loading for the type |
| DynamicUpdate | Boolean | From NHibernate documentation: Specifies that UPDATE SQL should be generated at runtime and contain only those columns whose values have changed. |
| DynamicInsert | Boolean | From NHibernate documentation: Specifies that INSERT SQL should be generated at runtime and contain only the columns whose values are not null. |
| Persister | Type | From NHibernate documentation: Specifies a custom NHibernate.Persister.IClassPersister. |
| SelectBeforeUpdate | Boolean | From NHibernate documentation: Specifies that NHibernate should never perform an SQL UPDATE unless it is certain that an object is actually modified. In certain cases (actually, only when a transient object has been associated with a new session using update()), this means that NHibernate will perform an extra SQL SELECT to determine if an UPDATE is actually required. |
| Polymorphism | Polymorphism | From NHibernate documentation: Determines whether implicit or explicit query polymorphism is used. |
| Mutable | Boolean | From NHibernate documentation: Specifies that instances of the class are (not) mutable. |
| BatchSize | Int32 | From NHibernate documentation: Specify a "batch size" for fetching instances of this class by identifier. |
| Locking | OptimisticLocking | From NHibernate documentation: Determines the optimistic locking strategy. |
| UseAutoImport | Boolean | From NHibernate documentation: The auto-import attribute lets us use unqualified class names in the query language, by default. The assembly and namespace attributes specify the assembly where persistent classes are located and the namespace they are declared in. |
| Cache | CacheEnum | Gets or sets the cache strategy to use for this property |
| Access | PropertyAccess | Gets or sets the access strategy for this property |
| CustomAccess | String | Gets or sets the custom access strategy |
| AccessString | String | Gets the access strategy string for NHibernate's mapping. |