Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate POJO class grtter method

 
Hemakanta Sethi
Greenhorn
Posts: 17
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

In Hibernate I have a POJO class(Employee), contain employeeId.
we generally create getter method as getEmployeeId.

public class MyEmployee
{
private String employeeId;
public String getEmployeeId(){
return employeeId;
}
public void setEMployeeId(String employeeId){
this.employeeId = employeeId;
}
}

/////////////////////////////////////////////

In th e above code can i declare
public static String getEmployeeId(){
return employeeId;
}

if No then why?
 
Vijitha Kumara
Bartender
Pie
Posts: 3930
21
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why would you want to do that in the first place? Shouldn't the Id be unique to each instance?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic