I have the table A like below:
Table A
-----------------------
Id
Desc
ReferenceType
TargetId
...
Depend on the value of reference type, eg 'B' or 'C', target ID reference to table B or table C. Have anyone solve this problem with NHibernate.
I have the table A like below:
Table A
-----------------------
Id
Desc
ReferenceType
TargetId
...
Depend on the value of reference type, eg 'B' or 'C', target ID reference to table B or table C. Have anyone solve this problem with NHibernate.
You are looking for the mapping <any>
have a look at this blog post.
Or in this Fabio Maulo Knol look for 5.2.4. Any type mappings
You need to look at discriminators I think. The following articles should help.
http://nhforge.org/blogs/nhibernate/archive/2009/04/10/nhibernate-mapping-inheritance.aspx