Hi, if you map a relation or collection you can use the property-ref attribute to make NHibernate work with legacy data. That's very useful and works as it shoudl. But in my current project nearly all tables have composite ids and relations also use them. As far as I know it is not possible to use the property-ref attribute on the columns of those composite ids. So many relations in this legacy database can't be mapped by NHibernate due to the lack of this functionality...
I would really appreciate the possiblity of telling NHibernate to take the property-ref attribute in composite ids...
The mapping for that could be like the following I think:
For this example you can imagine that the table holding that collection has a few columns (e.g. CUSTOM_COL) and the composite id with the columns ID1 and ID2. The table COLL has the composite id of CUSTOM_COL and ID2...
I know many projects that have such a legacy structure and it would be very nice if you could add the described functionality to support those projects...
Thanks
Environment
None
Activity
Gerke Geurts
December 2, 2009 at 4:52 AM
Hibernate supports this functionality by grouping <property> elements that form a alternative key in a named <properties> element. The collection <key> element can then have a property-ref attribute that refers to the name of the <properties> group. So this issue comes down to porting existing Hibernate functionality to NHibernate.
Hi,
if you map a relation or collection you can use the property-ref attribute to make NHibernate work with legacy data. That's very useful and works as it shoudl. But in my current project nearly all tables have composite ids and relations also use them. As far as I know it is not possible to use the property-ref attribute on the columns of those composite ids. So many relations in this legacy database can't be mapped by NHibernate due to the lack of this functionality...
I would really appreciate the possiblity of telling NHibernate to take the property-ref attribute in composite ids...
The mapping for that could be like the following I think:
For this example you can imagine that the table holding that collection has a few columns (e.g. CUSTOM_COL) and the composite id with the columns ID1 and ID2. The table COLL has the composite id of CUSTOM_COL and ID2...
I know many projects that have such a legacy structure and it would be very nice if you could add the described functionality to support those projects...
Thanks