Hi guru I have 2 table
Emp table wit the following field:
and a second table JobDescr containing the following fields:
-jobId
-JobDescription.
The key of emp is empno and the key of JobDescr is jobId.
There is also a foreing key among JobId on Emp and Jobid on JobDescr
I'd like to build a class emp as follow
Code:
public class Emp java.io.Serializable {
private BigDecimal empno;
private String ename;
private BigDecimal jobId;
private String jobDescription;
public Emp() {
}
public BigDecimal getEmpno() {
return this.empno;
}
public void setEmpno(BigDecimal empno) {
this.empno = empno;
}
public String getJobId() {
return this.jobId;
}
public void setJob(String job) {
this.jobId = job;
}
public String getEname() {
return this.ename;
}
public void setEname(String ename) {
this.ename = ename;
}
//Read only
public String getJobDescription() {
return this.jobDescription;
}
so the query to retrieve an emp entity should be:
Code:
select ename,jobId,jobDescription
from emp, job
where emp.jobId=JobDescr.jobId
Unfortunately I'm unable how configure my hbm.
Shoud I use UserType?
any help will be appreciate.
thanks in advance
Marco