Link Details

Link 84171 thumbnail
User 1 avatar

By rick
via oracle.com
Published: May 31 2008 / 14:32

Consider and employ these simple approaches to make your Java Persistence API applications more maintainable.
  • 23
  • 0
  • 2555
  • 709

Comments

Add your comment
User 131196 avatar

Jakob Jenkov replied ago:

0 votes Vote down Vote up Reply

I must say, that I disagree with the articles argument about annotating fields rather than getters and setters. By using getter / setter annotation you can specify that a field is to be read from DB (annotate the setter), but never written (don't annotate getter). You can also split a db-field into two fields inside a setter, and join two object fields into one in a getter. In general I personally find using getters / setters a much more flexible mechanism when working with persistence.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.