Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Best place for @Column annotations in Hibernate POJO classes -- variable or method?  RSS feed

James Adams
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have inherited some annotated Hibernate POJO classes in which the @Column annotations are used on the get*() methods. My preference would be for the annotations to be placed on the member variable declarations instead, as this seems more logical and readable. However I am new to Hibernate annotations and so I wonder what is the best practice -- method level or variable level annotations?

If anyone can comment on this then I'd appreciate your insight. Thanks in advance.

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!