Hi, I'm new to hibernate.
I need to retrieve only jobs with company that is not a testcompany (Company.isTestCompany = false)
Question: Is it possible to make an inner join on company from Job where Company.isTestCompany = false, without doing it in hql ?
Tried to put a @Where(clause="a_isTestCompany = false") in Company, but that fails on ObjectNotFoundException (no row with the given identifier...)
Classes: @Entity @Table(name = "a_job") public class JobOpening implements { @Id @Column(name = "a_jobid", unique = true, nullable = false) private int jobid;
@ManyToOne @JoinColumn(name = "a_company") private Company company; ... } @Entity @Table(name = "a_company") public class Company implements { @Id @Column(name = "a_companyId") private short companyId;
@Column(name = "a_isTestCompany") private boolean isTestCompany; ... }
|