Re: Mananged many-to-one references

[email protected] Wed, 14 Apr 2010 16:45:56 +1000
Newsgroups gmane.comp.java.orm.simpleorm
Message-ID <[email protected]>
Hello Mike,

To get all the details for a master just do a query, eg.  Emps where Dept='mydept'.  You will then have a list of Emps.

To find all details that for a master *in a dataset*, do SDataSet.findReferencing.  They will be sorted in the order that they were added etc.   Useful if detached.

There is really not much else one could do.  Not much point in making a special case for the query as it is only one line anyway.

There is a misconception from using low level C++/Java constructs that the one and the many ends of the association need to be handled separately.  (That is confusing in Hibernate.)  Whereas we just look on it as a simple query.

I'll have a look at your bug report later, odd that a unit test does not pass.  I did not write that one,  it is testing key only records which is something that we should revisit one day.

Regards,

Anthony

At 07:54 AM 13/04/2010, you wrote:
>  
>
>Hi,
>
>I've had a browse through some of the past emails on this list and I
>noticed that managed many-to-one objects have been proposed before.
>The suggestion was to have a method findReferencing() . I cannot
>find* that email again, but the method was deemed unnecessary/too
>complicated. Perhaps I could get more explanation on why this is the
>case. I think I understand the DataSet/custom query issues, but I
>believe it is an important use case and should be handled.
>
>My understanding is that it should be similar semantically to
>findReference(), except instead of returning a single value it should
>return a Set of values. If the DataSet is disconnected then an
>appropriate exception is thrown, stating that the data is not
>available. If a custom query is executed then the engine could
>optionally use the values already returned by findReferences (if it
>has been called), or more simply go to the database. Additionally it
>would be good if there was a method on SRecordInstance to fully
>resolve all of its dependencies recursively in one go.
>
>In many use cases there is a hierarchy (for example Invoice->Items)
>and the entire hierarchy is of interest for all operations. So it
>would be nice if a managed many-to-one reference set object would
>manage updates. It seems to me that this is one of the most common use
>cases in an ORM framework and I am finding that I have to manage
>referencing entities manually.
>
>thoughts and criticisms welcome!
>
>- mike
>
>* Actually it seems to me that yahoogroups is not publically
>searchable, which is unfortunate.
>

Dr Anthony Berglas, [email protected]       Mobile: +61 4 4838 8874
Just because it is possible to push twigs along the ground with ones nose
does not necessarily mean that is the best way to collect firewood.



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/SimpleORM/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/SimpleORM/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/