The largest Interview Solution Library on the web


Hibernate Tutorials/
« Previous | 1 | 2 | 3 | Next »
Now let us modify a little bit our first example where we used EMPLOYEE table and Employee class to play with:

publicclassEmployee{
privateint id;
privateString firstName;
privateString lastName;
privateint salary;

publicEmployee(){}
publicEmployee(String fname,String lname,int salary){
this.firstName = fname;
this.lastName = lname;
this.salary = salary;
}
publicint getId(){
return id;
}
publicvoid setId(int id ){
this.id = id;
}
publicString getFirstName(){
return firstName;
}
publicvoid setFirstName(String first_name ){
this.firstName = first_name;
}
publicString getLastName(){
return lastName;
}
publicvoid setLastName(String last_name ){
this.lastName = last_name;
}
publicint getSalary(){
return salary;
}
publicvoid setSalary(int salary ){
this.salary = salary;
}
}
« Previous | 1 | 2 | 3 | Next »


copyright © 2014 - all rights riserved by javatechnologycenter.com