The moose likes Object Relational Mapping and the fly likes Anotation location Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Object Relational Mapping
Reply Bookmark "Anotation location" Watch "Anotation location" New topic
Author

Anotation location

manu chaox
Ranch Hand

Joined: Apr 10, 2006
Posts: 110
Hi,

where is better to locate an annotation like @Id, @OneToMany etc., before field or getter ?
Could you give reason for it ?

Thanks
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 16624

Check the link in this link

http://www.coderanch.com/t/487101/Object-Relational-Mapping/java/field-or-property-based-annotation

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4962

I'm seeing more and more implementations that put the annotation on the field.


Author of Hibernate Made Easy, What is WebSphere???, JSF 2.0 Made Easy and the SCJA Certification Guides
 
IntelliJ Java IDE
 
subject: Anotation location
 
MyEclipse, The Clear Choice