[Missing namespace summary documentation for N:Castle.ActiveRecord]
Syntax
| C# |
|---|
namespace Castle.ActiveRecord |
Classes
| Class | Description | ||
|---|---|---|---|
| ActiveRecordAttribute |
Associate meta information related to the
desired table mapping.
| ||
| ActiveRecordBase |
Base class for all ActiveRecord classes. Implements
all the functionality to simplify the code on the
subclasses.
| ||
| ActiveRecordBase<(Of <T>)> |
Base class for all ActiveRecord Generic classes.
Implements all the functionality to simplify the code on the subclasses.
| ||
| ActiveRecordBaseQuery |
Base class for all ActiveRecord queries.
| ||
| ActiveRecordHooksBase |
Base class for ActiveRecord entities
that are interested in NHibernate's hooks.
| ||
| ActiveRecordMediator |
Allow programmers to use the
ActiveRecord functionality without direct reference
to ActiveRecordBase | ||
| ActiveRecordMediator<(Of <T>)> |
Allow programmers to use the
ActiveRecord functionality without extending ActiveRecordBase | ||
| ActiveRecordSkipAttribute |
Denotes that the specific class -
which is an ActiveRecordBase subclass
should not be processed by the framework
| ||
| ActiveRecordStarter |
Performs the framework initialization.
| ||
| ActiveRecordValidationBase |
Extends ActiveRecordBase adding automatic validation support.
| ||
| ActiveRecordValidationBase<(Of <T>)> |
Extends ActiveRecordBase adding automatic validation support.
ActiveRecordValidationBase..::IsValid()() | ||
| Any |
Avoids the AnyAttribute.MetaValue syntax
| ||
| Any..::MetaValueAttribute |
This is used to specify a meta value in an [Any] assoication
Any.MetaValue is used to connect a value (such as "CREDIT_CARD") to its type ( typeof(CreditCard) ).
| ||
| AnyAttribute |
This attribute is used to create <any/> assoication, a polymorphic assoication to classes that
do not share a common base class.
|
[Any(typeof (long), MetaType=typeof (string), TypeColumn="BILLING_DETAILS_TYPE", IdColumn="BILLING_DETAILS_ID", Cascade=CascadeEnum.SaveUpdate)] [Any.MetaValue("CREDIT_CARD", typeof (CreditCard))] [Any.MetaValue("BANK_ACCOUNT", typeof (BankAccount))] public IPayment Payment { get { ... } set { ... } } |
Implement common properties shared by some
attributes
Maps a one to one association.
Used for a collection that requires a collection id.
Defines that the target property is a composite key
for the scope class
Maps the property to db using a NHibernate's ICompositeUserType.
Maps a standard column of the table.
Maps a many to many association with an association table.
Maps a one to many association.
This attribute allows polymorphic association between classes that doesn't have a common root class.
In require two columns that would tell it what is the type of the asssoicated entity, and what is the PK of that entity.
Remarks
This is supplied for advanced sceanrios.
Examples
For instnace, let assume that you have two classes (that implement a common interface, but have no base classs) called:
- Back Account
- Credit Card
And you have a set of Payment methods, that can be either. You would define the mapping so:
CopyC#
typeof(IPayement) - the common interface tha both classes implement, and the type of all the items in the set.
"pay_id" - the column that hold the PK of this entity (the FK column)
"payments_table" - the table that has the assoication information (in 1:M scenarios - usuaully the same table, in M:N scenarios the link table).
typeof(int) - the type of id column
"payment_type" - the column used to find out which class is represented by this row.
"payment_method_id" - the column that holds the PK of the assoicated class (either CreditCard or BankAccount).
MetaType = typeof(int) - the type of the meta column (payment_type)
RelationType = RelationType.Set - specify that we use a set here
[HasManyToAny(typeof(IPayment), "pay_id", "payments_table", typeof(int), "payment_type", "payment_method_id", MetaType = typeof(int), RelationType = RelationType.Set)] |
Used when a constraint requires a hilo algorithm
This is used to define a named HQL query.
It represents the <query> element.
This is used to map between a type to a friendly name that can be used in the queries.
This attribute is representing an <import/> in the mapping files
Denotes that a class is the parent class of one or
more subclasses using a join
Used for joined subclasses.
A key property for a composite key
Maps properties of a child object to columns of the table
of a parent class.
Maps a property of a child object to its parent object.
This exception is thrown when loading an entity by its PK failed because the entity did not exist.
Associates a foreign table where the current class
and the target class share their primary key.
Indicates the property which is the primary key.
Utility class to help convert between PropertyAccess values and
NHiberante's access strategies.
Maps a standard column of the table.
Abstract base class for custom attributes that can generate XML and return it directly.
This allows to customize the generate the XML passed to NHibernate in a flexible way.
Base class to define common relation information
Implementation of ISessionScope to
augment performance by caching the session, thus
avoiding too much opens/flushes/closes.
Specify that this property is used for timestamping this entity
Implementation of ISessionScope to
provide transaction semantics
Validate that the property's value is unique in the database when saved
This attribute is used to specify that a property is the versioning property of the class
Base class that allows specifying an access strategy to get/set the value for an object' property.
Interfaces
| Interface | Description | |
|---|---|---|
| IActiveRecordQuery |
Represents an ActiveRecord Query.
| |
| IActiveRecordQuery<(Of <T>)> |
Represents an ActiveRecord Query.
| |
| ISessionScope |
Contract for implementation of scopes.
|
Delegates
| Delegate | Description | |
|---|---|---|
| ModelsCreatedDelegate |
Delegate for use in ModelsCreated | |
| NHibernateDelegate |
Allow custom executions using the NHibernate's ISession.
| |
| SessionFactoryHolderDelegate |
Delegate for use in SessionFactoryHolderCreated |
Enumerations
| Enumeration | Description | |
|---|---|---|
| CacheEnum |
Define the caching options
| |
| CascadeEnum |
Defines the cascading behaviour of this association.
| |
| CollectionIDType |
Defines the values for the generator for the Collection Id values.w
| |
| FetchEnum |
Define the possible fetch option values
| |
| FlushAction |
Pendent
| |
| ManyRelationCascadeEnum |
Defines the cascading behaviour of this association.
| |
| NotFoundBehaviour |
Define how broken relations should be handled.
| |
| OnDispose |
Governs the TransactionScope behavior
on dispose if neither VoteCommit()()
nor VoteRollBack()() was called
| |
| OptimisticLocking |
Defines the values for optimistic locking
| |
| OuterJoinEnum |
Define outer join options
| |
| Polymorphism |
Define the polymorphism options
| |
| PrimaryKeyType |
Define the possible strategies to set the Primary Key values
| |
| PropertyAccess |
Define the various access strategies NHibernate will use to set/get the value
for this property.
| |
| RelationType |
Define the relation type for a relation.
| |
| SessionScopeType |
Define session scope types
| |
| TransactionMode |
Defines the transaction scope behavior
|