openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Goodenough <>
Subject Having built a customizer..
Date Fri, 08 Feb 2008 15:09:40 GMT
and generated a Bean which is nearly what I want (it has properly change
support, and also generates some static fields I want ... a class field,
a Property field which has a JSR-296 BeanProperty in it, and shortly I 
will add a length field as well ... which I notice is in the @Column
annotation, so I may not need this as it is already there, I am now
moving on nicely.

But some observations/question occur...

1) Why is the constructor build from the individual primary keys (when
there are more than one) rather than an <class>Id object?

2) I notice that the classes I generate from Sql2Java kept track of whether
a bean was new (i.e did not get loaded from the DB) and whether each field
had been modified.  This meant that I could simply save beans without regard
as to whether I was inserting or updating the record, and that I could save
all beans I had (say in a List) and it would only actually write those that
had been modified.  Is this done in some other way in openJPA or do I need
to add this as well.

3) The code I am generating is not very pretty.  Well that does not matter
really as I am not going to look at it and if I need to I could always run it
through a pretty-printer, or use Eclipse to reformat it, but looking at the
code I thought perhaps that I should be using CodeFormat to do it.  But there
seems rather little documentation on CodeFormat - few Javadoc comments and
nothing in the user manual.

4) Various of the customer exits provide ${} fields which will be substituted
into the generated code - is there a list showing how to get to these values
directly from the customiser methods?

Thanks for any insite,


PS, if anyone wants the Customiser I am quite happy to donate it to the
project.  My coding style is a little different to that used elsewhere in 
the project but if that matters to anyone they can always adjust it.  But
it would probably be better to wait until I have all the bits that I want to 
do to it fixed.

View raw message