[DOUBLEPOST]Sorry, i just figured that my original post
https://forum.hibernate.org/viewtopic.php?f=25&t=1009435 is in Hibernate instead of NHibernate... That may be the reason i'm not receiving any answer. Feel free to delete the original, sorry again for that.[/DOUBLEPOST]
Hello,
i'm very new to NHibernate (Indirectly, via ActiveRecord, but there is very low user community for the former... That's why i'm trying to ask here).
i'm currently working on a WCF project which uses Castle.ActiveRecord for persistency / abstraction layer. The client consuming the WCF service is Javascript based, and we use ExtJS as our main framework.
Now, let's say i have this:
- Table A.
- Table B with many-to-one to A.
- Table C with many-to-one B and many-to-one A.
All the database fields are mapped perfectly thru ActiveRecord to accessors. When doing for instance: A.find(), it works, and doing aInstance.deliveryBills also works.
Now, to allow the objects to be directly sent over the wire, accessors are marked DataMembers, and objects are DataContract'ed. My problem is that if a method of my WCF returns an instance of A, there is way too much recursion on the serialization...
i'd like to be able to specify a recursion level, but i have no idea on how to do it.
This parameter would ideally be dynamic enough so one function of the WCF service returning instances of A would *NOT* include any B, while another method of my service would return A including it's Bs -> Cs -> As
Any help would be greatly appreciated.
Thanks,
Pierre.