[Missing namespace summary documentation for N:Castle.ActiveRecord]

Syntax

C#
namespace Castle.ActiveRecord

Classes

  ClassDescription
Public classActiveRecordAttribute
Associate meta information related to the desired table mapping.
Public classActiveRecordBase
Base class for all ActiveRecord classes. Implements all the functionality to simplify the code on the subclasses.
Public classActiveRecordBase<(Of <T>)>
Base class for all ActiveRecord Generic classes. Implements all the functionality to simplify the code on the subclasses.
Public classActiveRecordBaseQuery
Base class for all ActiveRecord queries.
Public classActiveRecordHooksBase
Base class for ActiveRecord entities that are interested in NHibernate's hooks.
Public classActiveRecordMediator
Allow programmers to use the ActiveRecord functionality without direct reference to ActiveRecordBase
Public classActiveRecordMediator<(Of <T>)>
Allow programmers to use the ActiveRecord functionality without extending ActiveRecordBase
Public classActiveRecordSkipAttribute
Denotes that the specific class - which is an ActiveRecordBase subclass should not be processed by the framework
Public classActiveRecordStarter
Performs the framework initialization.
Public classActiveRecordValidationBase
Extends ActiveRecordBase adding automatic validation support.
Public classActiveRecordValidationBase<(Of <T>)>
Extends ActiveRecordBase adding automatic validation support. ActiveRecordValidationBase..::IsValid()()
Public classAny
Avoids the AnyAttribute.MetaValue syntax
Public classAny..::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) ).
Public classAnyAttribute
This attribute is used to create <any/> assoication, a polymorphic assoication to classes that do not share a common base class.

Examples

Assuming we have two classes that implement IPayment, CreditCard and BankAccount, and we want a property that can point ot either one of them. We can map it like this:
CopyC#
[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 { ... } }
The [Any] attribute specify that the id type is long, that the meta type (the type that specify the type of the class) is string. The TypeColumn = "BILLING_DETAILS_TYPE" means that Active Record will look in this column to figure out what the type of the associated entity is. The IdColumn = "BILLING_DETAILS_ID" means that Active Record will use this column in conjuction with the type of the entity to find the relevant entity. This is the id of the associated entity (which can point to either back account or credit card). Cascade has the usual semantics. [Any.MetaValue("CREDIT_CARD", typeof (CreditCard))] - means that when Active Record encounters a "CREDIT_CARD" value in the "BILLING_DETAILS_TYPE", is assumes that the id in the "BILLING_DETAILS_ID" is the id of a CreditCard entity. [Any.MetaValue("BANK_ACCOUNT", typeof (BankAccount))] - same, just for "BANK_ACCOUNT" meaning that the id in "BILLING_DETAILS_ID" is an id of a bank account.
Public classBaseAttribute
Implement common properties shared by some attributes
Public classBelongsToAttribute
Maps a one to one association.
Public classCollectionIDAttribute
Used for a collection that requires a collection id.
Public classCompositeKeyAttribute
Defines that the target property is a composite key for the scope class
Public classCompositeUserTypeAttribute
Maps the property to db using a NHibernate's ICompositeUserType.
Public classFieldAttribute
Maps a standard column of the table.
Public classHasAndBelongsToManyAttribute
Maps a many to many association with an association table.
Public classHasManyAttribute
Maps a one to many association.
Public classHasManyToAnyAttribute
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#
[HasManyToAny(typeof(IPayment), "pay_id", "payments_table", typeof(int), "payment_type", "payment_method_id",
    MetaType = typeof(int), RelationType = RelationType.Set)]
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
Public classHiloAttribute
Used when a constraint requires a hilo algorithm
Public classHqlNamedQueryAttribute
This is used to define a named HQL query. It represents the <query> element.
Public classImportAttribute
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
Public classJoinedBaseAttribute
Denotes that a class is the parent class of one or more subclasses using a join
Public classJoinedKeyAttribute
Used for joined subclasses.
Public classKeyPropertyAttribute
A key property for a composite key
Public classNestedAttribute
Maps properties of a child object to columns of the table of a parent class.
Public classNestedParentReferenceAttribute
Maps a property of a child object to its parent object.
Public classNotFoundException
This exception is thrown when loading an entity by its PK failed because the entity did not exist.
Public classOneToOneAttribute
Associates a foreign table where the current class and the target class share their primary key.
Public classPrimaryKeyAttribute
Indicates the property which is the primary key.
Public classPropertyAccessHelper
Utility class to help convert between PropertyAccess values and NHiberante's access strategies.
Public classPropertyAttribute
Maps a standard column of the table.
Public classRawXmlMappingAttribute
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.
Public classRelationAttribute
Base class to define common relation information
Public classSessionScope
Implementation of ISessionScope to augment performance by caching the session, thus avoiding too much opens/flushes/closes.
Public classTimestampAttribute
Specify that this property is used for timestamping this entity
Public classTransactionScope
Implementation of ISessionScope to provide transaction semantics
Public classValidateIsUniqueAttribute
Validate that the property's value is unique in the database when saved
Public classVersionAttribute
This attribute is used to specify that a property is the versioning property of the class
Public classWithAccessAttribute
Base class that allows specifying an access strategy to get/set the value for an object' property.

Interfaces

  InterfaceDescription
Public interfaceIActiveRecordQuery
Represents an ActiveRecord Query.
Public interfaceIActiveRecordQuery<(Of <T>)>
Represents an ActiveRecord Query.
Public interfaceISessionScope
Contract for implementation of scopes.

Delegates

  DelegateDescription
Public delegateModelsCreatedDelegate
Delegate for use in ModelsCreated
Public delegateNHibernateDelegate
Allow custom executions using the NHibernate's ISession.
Public delegateSessionFactoryHolderDelegate
Delegate for use in SessionFactoryHolderCreated

Enumerations

  EnumerationDescription
Public enumerationCacheEnum
Define the caching options
Public enumerationCascadeEnum
Defines the cascading behaviour of this association.
Public enumerationCollectionIDType
Defines the values for the generator for the Collection Id values.w
Public enumerationFetchEnum
Define the possible fetch option values
Public enumerationFlushAction
Pendent
Public enumerationManyRelationCascadeEnum
Defines the cascading behaviour of this association.
Public enumerationNotFoundBehaviour
Define how broken relations should be handled.
Public enumerationOnDispose
Governs the TransactionScope behavior on dispose if neither VoteCommit()() nor VoteRollBack()() was called
Public enumerationOptimisticLocking
Defines the values for optimistic locking
Public enumerationOuterJoinEnum
Define outer join options
Public enumerationPolymorphism
Define the polymorphism options
Public enumerationPrimaryKeyType
Define the possible strategies to set the Primary Key values
Public enumerationPropertyAccess
Define the various access strategies NHibernate will use to set/get the value for this property.
Public enumerationRelationType
Define the relation type for a relation.
Public enumerationSessionScopeType
Define session scope types
Public enumerationTransactionMode
Defines the transaction scope behavior