views:

29

answers:

1

For some reason in a legacy database I am working with does not have any relationship defined. I have TableA mapped to ClassA. Now in ClassA I need to add PropertyB which has a corresponding column in TableB. How can we add this without adding a Relation?

I am using Castle Active Record over nHibernate.

+2  A: 

You may be able to use the join element in your mapping to accomplish this.

Jamie Ide
@Jamie:Do you know the corresponding feature in Castle Active Record?
Amitabh
No idea, I've never used it. I did a little googling but didn't turn up anything. It might be easier to just map a view if PropertyB is read only.
Jamie Ide
@Amitabh: use the JoinedTableAttribute: http://svn.castleproject.org:8080/svn/castle/ActiveRecord/trunk/src/Castle.ActiveRecord.Tests/Model/Person.cs
Mauricio Scheffer