> 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...
> Based on your feedback, it seems that doing this generically is not
> the wisest choice, but rather to hand-code in my model subclasses a
> finder by PK.
>
My biggest concern is tackled with a bit of velocity cleverness...
detecting an entity that has a compound key and changing your method
signature to require a Map in that case.
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.
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.
Cris
This archive was generated by hypermail 2.0.0 : Wed May 11 2005 - 13:54:51 EDT