aspose file tools
The moose likes Object Relational Mapping and the fly likes Hibernate POJO class grtter method Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Object Relational Mapping
Reply Bookmark "Hibernate POJO class grtter method" Watch "Hibernate POJO class grtter method" New topic
Author

Hibernate POJO class grtter method

Hemakanta Sethi
Greenhorn

Joined: Jul 19, 2011
Posts: 17

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

Joined: Mar 24, 2008
Posts: 3563

Why would you want to do that in the first place? Shouldn't the Id be unique to each instance?


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
 
 
subject: Hibernate POJO class grtter method
 
Threads others viewed
Joining tables
EJB PK class
Need to know Java logic to form a setter method for XML property
set and get methods
Struts Action not Forwarding to jsp........
MyEclipse, The Clear Choice