On Fri, 2008-01-25 at 08:18 -0800, Patrick Linskey wrote: > > designed to attach generator annotation for numeric keys. However, I'm > > doing this by brute force, overriding the getDeclaration method. I think > > that there's a more elegant way to do this in the customize method for > > fields. Does anyone know how? I'm emitting the following: > > Reading the code, it looks like you might be able to mutate the field > mapping in customize(FieldMapping) to configure the identity > generation, and the annotations might get written out automatically. >
That's what I figured. Just can't see an obvious part of the field definition to modify in order to get what I want. On top of that, I switched DBMS's, so now I'm having to inject both strategy and generator (sequence) definitions, but that may or may not complicate items further. > > Also, is there a way to inject lazy/eager fetch and/or fetch group info > > on the customize method? > > The same approach I outlined above should also work for fetch group as well. > This one I wasn't so sure of. IIRC, the problem with generators was too many choices, but the problem with fetch groups is I didn't find any likely-looking candidates at all. Tim > -Patrick > > On Jan 21, 2008 12:48 PM, Tim Holloway <[EMAIL PROTECTED]> wrote: > > I've been playing around with a customizer for openjpa reverse mapping, > > designed to attach generator annotation for numeric keys. However, I'm > > doing this by brute force, overriding the getDeclaration method. I think > > that there's a more elegant way to do this in the customize method for > > fields. Does anyone know how? I'm emitting the following: > > > > @Id > > @GeneratedValue(strategy=GenerationType.IDENTITY) > > @Column(name="stop_id", columnDefinition="int4") > > private int stopId; > > > > Also, is there a way to inject lazy/eager fetch and/or fetch group info > > on the customize method? > > > > Tim Holloway > > > > > > >
