不知道下面的方法是怎么调用执行返回的,请各位高手指点一下:下面是调用的方法
Sex sex = personManage.findSex(3);
下面是 personManage.findSex(3)方法:
//根据sexId查询Sex
public Sex findSex(int sexId){
try{
Sex sex = (Sex)this.getHibernateTemplate().get("entity.Sex", sexId);
return sex;
}catch (RuntimeException re) {
throw re;
}
}
下面是entity.Sex实体类:
package entity;@SuppressWarnings("serial")
public class Sex implements java.io.Serializable { private Integer sexId;
private String sexType; public Sex() {
} public Sex(String sexType) {
this.sexType = sexType;
} public Integer getSexId() {
return this.sexId;
} public void setSexId(Integer sexId) {
this.sexId = sexId;
} public String getSexType() {
return this.sexType;
} public void setSexType(String sexType) {
this.sexType = sexType;
}}
它传入的是personManage.findSex(3)方法参数是3,然后又根据这个ID值查出并返回一个sex对象,但这里的参数3是什么意思,为什么是3然后personManage.findSex(3)方法是怎么执行的,又是怎么返回sex对象的,它和实体类有什么关系,麻烦各位帮忙看看。