nHibernate Envers with Composite Key

Description

Stuck again with Composite Key and its now with Enverse.

It says "Model, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null is currently not supported in Envers. If you need composite-id, use 'Components as composite identifiers'."

What do you mean by Component as composite identifier now. What should i change to make it work. ???

public class DealDetail {
public virtual Deal Deal { get; set; }
public virtual DealType Type { get; set; }
public virtual int MainTopic { get; set; }

public override bool Equals(object obj) {
if (obj == null)
return false;

DealDetail t = obj as DealDetail;

if (t == null)
return false;

if (t.Deal == Deal && t.Type == Type)
return true;

return false;
}

public override int GetHashCode() {
int hash = 13;

hash += (null == Deal ? 0 : Deal.GetHashCode());
hash += (null == Type ? 0 : Type.GetHashCode());

return hash;
}
}
Mapping here

public class DealDetailMap : ClassMap<DealDetail> {

public DealDetailMap() {
Table("dealtype_m");
CompositeId().KeyReference(x => x.Deal, "deal_id")
.KeyReference(x => x.Type, "deal_type");

Map(x => x.MainTopic, "main_topic").Not.Nullable();
}
}
Help me out with this..

Many Thanks, Su..

Environment

None

Activity

Show:

Roger January 15, 2016 at 2:05 PM

Send questions to NH user list (or SO).

Won't Fix

Details

Assignee

Reporter

Components

Affects versions

Priority

Who's Looking?

Open Who's Looking?

Created July 14, 2013 at 7:23 AM
Updated January 15, 2016 at 2:05 PM
Resolved January 15, 2016 at 2:05 PM
Who's Looking?

Flag notifications