• Post Reply Bookmark Topic Watch Topic
  • New Topic

[JPA] field or property annotation style..

 
James Clinton
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!