NH3.2: Component as CompositeID

20 views
Skip to first unread message

ilyad

unread,
Dec 23, 2011, 8:46:04 AM12/23/11
to ConfORM
The entity key is structure:

struct MyEntityKey
{
public int Key1 {get; protected set;}
public string Key2 {get; protected set;}

//ctor, equals, gethashcode miss
}


My entity:
class MyEntity
{
// my composite key
public virtual MyEntityKey ID {get; protected set;}

public virtual string SomeProperty {get; protected set;}

//ctor, equals, gethashcode miss
}

Please, help me configure mapping for this entity.

class MyEntityMapping : ClassMapping<MyEntity>
{
public MyEntityMapping()
{
// what I must write here?
}
}

Fabio Maulo

unread,
Dec 24, 2011, 7:11:52 AM12/24/11
to codec...@googlegroups.com
The question is about NHibernate not about ConfORM.
By have a look to 
ComponentAsId<MyEntityKey>()
--
Fabio Maulo

Reply all
Reply to author
Forward
0 new messages