Re: Binding queries to ObjEntity

From: Mike Kienenberger (mkienen..mail.com)
Date: Tue Sep 06 2005 - 11:33:29 EDT

  • Next message: Andrus Adamchik: "Re: XMLEncoder feature in 1.2"

    You can always manually add methods to your DataObject subclasses to
    encapsulate this behavior.

    It's probably possible to create a class generation template to add
    these to your _DataObject class, although I haven't looked to see how
    queries are represented in maps yet.

    On 9/5/05, Gili <cowwo..bs.darktech.org> wrote:
    > Hi,
    >
    > Would it make sense to bind queries directly to an ObjEntity? As I
    > understand it, ObjEntity "relationships" are nothing more than queries
    > that are bound to the ObjEntity but have no qualifiers. It would be nice
    > to be able to declare more complex queries (with qualifiers) be able to
    > invoke them directly from the object. For example, I'd define a
    > SelectQuery named "find" in the modeler and assign it the qualifier:
    >
    > "theme = $theme and provider = $provider"
    >
    > then from within my code I'd be able to invoke:
    >
    > myImage.find(myTheme, myProvider)
    >
    > and Cayenne will bind myTheme to $theme, myProvider to $provider. Note
    > that the above query has an implicit condition "image = $image". If a
    > query is bound to an Image ObjEntity Cayenne should be smart enough to
    > bind $image to "this".
    >
    > What do you think?
    >
    > Gili
    > --
    > http://www.desktopbeautifier.com/
    >



    This archive was generated by hypermail 2.0.0 : Tue Sep 06 2005 - 11:33:30 EDT