NHibernate have 2 varieties of one-to-one association, primary key associations and unique foreign key associations. Castle ActiveRecord documentation describes just first varity, primary key associations.
But how about second variety, unique foreign key associations? Well, it can be implemented as follow. Please notice sample:
[ActiveRecord(Lazy = true)]
public class User : ActiveRecordBase
{
[PrimaryKey]
public virtual long ID { set; get; }
[Property]
public virtual string FirstName { set; get; }
[OneToOne(PropertyRef = “ContainerUser”)]
public virtual Profile ContainerProfile { set; get; }
}
[ActiveRecord(Lazy = true)]
public class Profile : ActiveRecordBase
[PrimaryKey]
public virtual long ID { set; get; }
[Property]
public virtual string Field1 { set; get; }
[BelongsTo(“ContainerUser”, Unique = true, NotNull = true)]
public virtual User ContainerUser { set; get; }
}