multiple key , BelongsTo => always null

Jan 7, 2009 at 6:00 AM

  public class ToolbarSchema : IDbObject
    {
        [HasMany(OrderBy = "ID")]
        public HasMany<ToolbarSchema> ToolbarSchemaList { get; set; }

        [AllowNull]
        [BelongsTo, DbColumn("ParentID")]
        public ToolbarSchema Parent { get; set; }

        [DbKey(IsDbGenerate = false)]
        public int ApplicationID{ get; set; }

        [Length(1)]
        [AllowNull]
        public string ButtonStyle { get; set; }

        [Length(32)]
        [AllowNull]
        public string Caption { get; set; }

        [AllowNull]
        public bool? Checked { get; set; }

        [Length(255)]
        [AllowNull]
        public string Comment { get; set; }

        [AllowNull]
        public bool? FollowSeperated { get; set; }

        [DbKey(IsDbGenerate = false)]
        public int? ID { get; set; }

        [Length(32)]
        public string Name { get; set; }

        [Length(500)]
        [AllowNull]
        public string Picture { get; set; }

        public short ToolbarLevel { get; set; }

        [Length(10)]
        [AllowNull]
        public string Type { get; set; }

    }


  [AllowNull]
        [BelongsTo, DbColumn("ParentID")]
        public ToolbarSchema Parent { get; set; }

 Parent  always null

Coordinator
Jan 7, 2009 at 9:38 AM
multiple PK class don't support any relations so the belongsTo equles null.

If you have rights to change the database schema I recommanded you to add PK Id and change the multiple PK to union index.