I am working with JPA application.The JPA annotations are applied on Getter methods and its working but when I am trying to apply the annotations on fields then compiler generate the error. I want to apply annotations on fields.
@Entity
@Table(name="TB_DEMO",query="select q from TB_DEMO q")
public class Demo extends DomainRoot{
@Column(name="VAR_COUNT")
private int varCount;
public int getCount(){
return this.varCount;
}
public void setCount(int count){
this.varCount=count;
}
}
Error: org.springframeowork.dao.InvalidDataResourceUsageException: Could not prepare statement
org.h2.jdbc.JdbcSQLException: Column "QSXXXXXXXX_.VARCOUNT" not found