Mananged many-to-one references

Mike Goodwin <[email protected]> Mon, 12 Apr 2010 22:54:11 +0100
Newsgroups gmane.comp.java.orm.simpleorm
Message-ID <[email protected]>
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.


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

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/