I have my friend's EJB project that uses hibernate. I am doing my Java project with help of that project. Mine is not an EJB, it is an desktop applicaiton. I have a small hibernate class mapping issue, that is in my friend's project, when I add a new field (say varchar) to database, I can use that field in relevant java class. For example.
In database I add, telephone_no to table A. I can use it like this
class A {
.......
private String telephoneNo;
public String getTelephoneNo(){
return this.telephoneNo;
}
public void setTelephoneNo(String telephoneNo){
this.telephoneNo = telephoneNo;
}
........
}
but my project, I have to use annotations to set the column name.
The puzzle is, how it resolve the variable name ?. I know in hibernate if the database field and the class variable name is same, then it will automatically maps, if not we should annotations or use xml to map, but in this case (my friend's project) how it automatically resolve ?
Also in my friend's EJB project, I don't see any class mapping at all, when we add table, then it automatically maps to relevant class (I mean after adding class to the EJB).
But how can I achieve this in my Java Desktop application ?