Home

Castle Stronghold

FieldAttribute API Document

Maps a standard column of the table.

Example

In the following example, the column is also called 'name', so you don't have to specify.


public class Blog : ActiveRecordBase
{
    [Field]
    string name;
    
    

Constructors

FieldAttribute()

Initializes a new instance of the Castle.ActiveRecord.FieldAttribute class.

FieldAttribute(String column)

Initializes a new instance of the Castle.ActiveRecord.FieldAttribute class.

ParameterDescription
column The column name.

FieldAttribute(String column, String type)

Initializes a new instance of the Castle.ActiveRecord.FieldAttribute class.

ParameterDescription
column The column name
type The column type.

Properties

NameTypeDescription
NotNullBoolean Gets or sets a value indicating whether the column allows null values
LengthInt32 Gets or sets the length of this column. char(10), etc
ColumnString Gets or sets the column name
UniqueKeyString From NHibernate documentation: A unique-key attribute can be used to group columns in a single unit key constraint.
IndexString From NHibernate documentation: specifies the name of a (multi-column) index
SqlTypeString From NHibernate documentation: overrides the default column type
CheckString From NHibernate documentation: create an SQL check constraint on either column or table
UpdateBoolean Set to false to ignore this field when updating entities of this ActiveRecord class.
InsertBoolean Set to false to ignore this field when inserting entities of this ActiveRecord class.
UniqueBoolean Gets or sets a value indicating whether this Castle.ActiveRecord.FieldAttribute is unique.
FormulaString Gets or sets the formula used to calculate this field
ColumnTypeString Gets or sets the type of the column.
AccessPropertyAccess Gets or sets the access strategy for this property
CustomAccessString Gets or sets the custom access strategy
AccessStringString Gets the access strategy string for NHibernate's mapping.

Google
Search WWW Search castleproject.org