cfraser wrote:
Just wondering if it is (relatively easily) possible to change the layout of the generated POJO code in terms of AccessType being Field rather than Property.
Not currently build in; but I guess it would be trivial to add logic in the templates to check the access type to control where the annotations goes.
Quote:
I have figured out how to use TableNameStrategy to put my generated classes into the right packages with a bit of renaming on the way, so that is all good (and very handy I might add!). Can you change the AccessType in a similar way?
not currently; but definitly doable - wanna contribute it ? :)
Quote:
Is the AccessType mainly a matter of style? Is there any reason to use Property over Field.
Use property if you want to be able to easily put a breakpoint to see what hibernate actually assigns/gets to/from your pojos.
Use field if you don't have any reason to have get/set properties for your fields or if the getter/setters might contain logic that conflicts with the semantics of hibernate/jpa.
Quote:
I have also found that the location of the &Id annotation determines the AccessType if it is not directly specified... Is there any advantage in explicitly setting it?
No, besides it being explicit.