• Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate POJO class grtter method  RSS feed

 
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
Posts: 4001
42
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
Boost this thread!