Parent property in ReadOnlyBaseParent property in ReadOnlyBase
Old forum URL: forums.lhotka.net/forums/t/8370.aspx
Kevin Fairclough posted on Friday, January 15, 2010
Hi
Why does ReadOnlyBase & ReadOnlyListBase not have Parent properties?
TIA
Kevin
Marjon1 replied on Sunday, January 17, 2010
There generally isn't a need for either of those objects to know about their parents. They cannot have validation rules, which is where the parent property is used the most within lists.
I think the more important question is what do you want to try and achieve by using this property on these objects? If we know that we might be able to point you in the right direction.
JohnKevin Fairclough replied on Monday, January 18, 2010
Hi
Currently I use bi-directional parent-child relationships because of NHibernate, this is working ok for editable objects as I have the Parent property which I use to obtain the true parent, bypassing the actual list parent.
I was trying to query my other similar objects (RO's) using the query language HQL (NHibernate.) My standard query for lazy collections uses ROChild.Parent = ?, but I have no parent property in my child object.
I managed to use get around the problem using the column directly in the HQL i.e. parent_id = ?, but it would be nice to query using the domain objects not direct columns.
Kevin
Copyright (c) Marimer LLC