NHIBERNATE 3.3: Does the composite-id generate a Key property?

I have read that this mapping is impossible in NHibernate 3.3:





****


Basically I need a composite id attribute to be automatically calculated by NH.

There may be one Tips for getting similarities?

Thanks in advance.

You have to implement it yourself, because CompositeIds always

class Digital
{
private static long number = 0;

private static long NextNumber()
{
return Interlocked.Increment(ref number);
}

public Digital()
{
Id = NextNumber ();
}
}

I have read that this mapping is not possible in NHibernate 3.3:





****


Basically I need a composite id Attributes are automatically calculated by NH.

Maybe there is a trick to get similarities?

Thanks in advance.

You have to implement it yourself, because CompositeIds always generate for NH allocation

< p>

class Digital
{
private static long number = 0;

private static long NextNumber()
{
return Interlocked.Increment(ref number);
}

public Digital()
{
Id = NextNumber();
}
}

Leave a Comment

Your email address will not be published.