Home

Castle Stronghold

PrimaryKeyAttribute API Document

Indicates the property which is the primary key.

Example


public class Blog : ActiveRecordBase
{
    ...
    
    [PrimaryKey(PrimaryKeyType.Native)]
    private int Id
    {
        get { return _id; }
        set { _id = value; }
    }

Constructors

PrimaryKeyAttribute()

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

PrimaryKeyAttribute(PrimaryKeyType generator)

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

ParameterDescription
generator The generator.

PrimaryKeyAttribute(PrimaryKeyType generator, String column)

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

ParameterDescription
generator The generator.
column The column.

Properties

NameTypeDescription
GeneratorPrimaryKeyType Gets or sets the generator.
ColumnString Gets or sets the column name
UnsavedValueString Gets or sets the unsaved value.
SequenceNameString Gets or sets the name of the sequence.
ColumnTypeString Gets or sets the type of the column.
LengthInt32 Gets or sets the length of values in the column
ParamsString Comma separated value of parameters to the generator
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