Hi,

To support the mapping of classes with inheritance, when NHMA looks
for attributes in the class TestDummyTest, it will also look in its
parent classes, but will stop if the parent also has a [Class]
attribute.

The easiest way to work around this behavior is to do something like:

class Test { [Id] public int Id { get ; private set; } }

[Class(NameType=typeof(Test), EntityName="Test1")]
class TestMapping: Test { } // For testing only! You can hide it by
making it internal/private

[Class(NameType=typeof(Test), EntityName="Test2")]
class TestDummyTest: Test { }

HTH,
Pierre Henri.

On Aug 14, 2:42 pm, ReverseBlade <[email protected]> wrote:
> Hello,
>
> How can I use entity-name via attributes ? Even creating a dummy class
> didn't work for me. for instance
>
> [Class(NameType="Test", EntityName="Test1")]
> class Test {      [Id] public int Id { get ; private set; }  }
>
> [Class(NameType="Test", EntityName="Test2")]
> class TestDummyTest: Test {     }
>
> Here in the generated XML for 2nd case I don't see the Id mapping.
> What should I do ?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"NHibernate Contrib - Development Group" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com.ar/group/nhcdevs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to