Home

Castle Stronghold

BelongsToAttribute API Document

Maps a one to one association.

Quick Note

Please note that the 'blogid' foreign key lies on the 'Post' table.

Example


public class Post : ActiveRecordBase
{
        ...

        [BelongsTo("blogid")]
        public Blog Blog
        {
        get { return _blog; }
        set { _blog = value; }
        }
    

Constructors

BelongsToAttribute()

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

BelongsToAttribute(String column)

Indicates the name of the column to be used on the association. Usually the name of the foreign key field on the underlying database.

ParameterDescription
column Missing documentation

Properties

NameTypeDescription
TypeType Defines the target type of the association. It's usually inferred from the property type.
ColumnString Defines the column used by association (usually a foreign key)
CompositeKeyColumnsString[] Defines the Composite Key columns used by association (aka Natural Keys).
CascadeCascadeEnum Defines the cascading behavior of this association.
OuterJoinOuterJoinEnum Defines the outer join behavior of this association.
UpdateBoolean Set to false to ignore this association when updating entities of this ActiveRecord class.
InsertBoolean Set to false to ignore this association when inserting entities of this ActiveRecord class.
NotNullBoolean Indicates whether this association allows nulls or not.
UniqueBoolean Indicates whether this association is unique.
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