Parent property in ReadOnlyBase
Parent property in ReadOnlyBaseOld forum URL: forums.lhotka.net/forums/t/8370.aspx
Kevin Fairclough posted on Friday, January 15, 2010Hi
Why does ReadOnlyBase & ReadOnlyListBase not have Parent properties?
Marjon1 replied on Sunday, January 17, 2010There 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.
Kevin Fairclough replied on Monday, January 18, 2010Hi
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.
Copyright (c) Marimer LLC