Re: superclass template question

From: Erik Hatcher (
Date: Wed May 11 2005 - 16:57:30 EDT

  • Next message: Ilya Lazarev: "Generating XML tree representation of related database data"

    On May 11, 2005, at 1:54 PM, Cris Daniluk wrote:

    >> The Object will come from DataObjectUtils.pkForObject(), so it'll be
    >> in a Cayenne-friendly format already. Maybe I should be
    >> using .compoundPKForObject instead? I do have some tables with
    >> compound primary keys, but have not used them with this approach yet.
    > Err, I'm confused :) pkForObject/compoundPKForObject are one thing and
    > objectForPK is another...

    You mentioned that the Object passed to my custom forPk(Object obj)
    method is too general. The Object passed to that method would come
    directly from Cayenne's PK for a DataObject instance. In other
    words, I'm essentially doing objectForPK(pkForObject()) which darn
    well better give me back the original object :)

    > As far as the subclass package, you may be able to get that from
    > what's provided to you. Velocity has a macro that is eluding me to
    > dump all properties of a bean, so you could use that on your classGen
    > and classGen.entity to see what's out there.

    It does have such a macro? Built-in? Hmmm.... wasn't aware of
    that. Send a pointer if you have something handy, otherwise I'll do
    my homework on it.

    > If the subclass package turns out to be unavailable, I can't think of
    > a reason why a patch adding it would not be a welcome thing.

    Cool... I'll give the design some more thought and see if I really
    need it or if hand coding static PK finders on my subclasses is more



    This archive was generated by hypermail 2.0.0 : Wed May 11 2005 - 16:57:55 EDT