The moose likes Object Relational Mapping and the fly likes [JPA] field or property annotation style.. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Object Relational Mapping
Reply Bookmark "[JPA] field or property annotation style.." Watch "[JPA] field or property annotation style.." New topic
Author

[JPA] field or property annotation style..

James Clinton
Ranch Hand

Joined: Jun 23, 2003
Posts: 190
In jpa, you have the option to annotate the entity field, property or both (however either or is recommended).

What is everyone doing and why?
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 16624

The option is on the property or on the method. Either is fine. However, I would use the method version when you need to add code. Otherwise I stick with on the property.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
IntelliJ Java IDE
 
subject: [JPA] field or property annotation style..
 
Threads others viewed
AccessMode in JPA 2
what is Field Access vs. Property Access in JPA ? please give example in detail
field or property based access
annotation on the property or access method?
field or property based access
developer file tools