Hi,
Is it possible with EJB 3.0 (or Hibernate) annotations to specify access strategies per field? I have an id field with only a getter since a setter seems weird for an assigned primary key. So I'd like to specify to my id field should be accessed by field. However, my other properties should be accessed by property get/set.
I can only find the class-level @Entity annotation where AccessType can be set, no field-level annotations.
My class file is like this:
Code:
@Entity(access = AccessType.PROPERTY)
public class Term {
@Id
private Long id;
private String otherProperty;
public Long getId() { return id; }
public String getOtherProperty() { return otherProperty; }
public void setOtherProperty(String param) { otherProperty = param; }
}
How do I specify that id is accessed by field and otherProperty by property?
Regards,
Ronald Wildenberg