RE: SingleObjectQuery & ObjectID

From: Dave Merrin (dmerri..pasystems.co.uk)
Date: Fri Feb 24 2006 - 04:33:05 EST

  • Next message: Pirola Davide: "HSQLDB"

    Hi Andrus,

    cheers for that. I've now run into the problem that my to-many relationships
    (from the newly retrieved object)(and possibly to-one relationships) are
    picking data up from the cache. How can I stop this from happening?

    Cheers,

    Dave

    > -----Original Message-----
    > From: Andrus Adamchik [mailto:andru..bjectstyle.org]
    > Sent: 23 February 2006 17:11
    > To: cayenne-use..bjectstyle.org
    > Subject: Re: SingleObjectQuery & ObjectID
    >
    >
    >
    > On Feb 23, 2006, at 12:00 PM, Dave Merrin wrote:
    >
    > > Hi,
    > >
    > > I've just come across the caching feature of objectForPK. This is
    > > causing me
    > > problems so I've had a look at the SingleObjectQuery. This looks
    > > much more
    > > like what I need.
    >
    > Yep, that's the way to go if you want to control cache behavior
    > manually.
    >
    >
    > > Now I'd like to modify my template to provide a method
    > > which creates an ObjectId given a pk value. Something a bit like:
    > >
    > > createObjectID(int value)
    > > {
    > > ObjectId result = new ObjectId(this.tablename,
    > this.pkColumn, value);
    > > return result;
    > > }
    > >
    > > This should be fine but what about the tables that have compound
    > > primary
    > > keys? Can I create an ObjectId given multiple columns?
    >
    > Absolutely. Look at other ObjectId constructors - ObjectId can take a
    > map of values.
    >
    > Andrus
    >



    This archive was generated by hypermail 2.0.0 : Fri Feb 24 2006 - 04:34:46 EST