Hello,
I have the following code:
Opfile opfile =
(Opfile) session
.createCriteria("com.test.beans.File")
.add(Restrictions.in("fileid", fileids))
.add(Restrictions.eq("filetype", "SE2"))
.uniqueResult();
which works just fine. Now i want to add a field which is in a table that is
joined in a one-to-one relation and i just get the instance by:
opfile.getOpdir()
as soon as i instantiate opfile the Opdir class is also available. Now, how
can i add a criteria from this joined table with .add() method for criterias?
like:
Opfile opfile =
(Opfile) session
.createCriteria("com.test.beans.File")
.add(Restrictions.in("fileid", fileids))
.add(Restrictions.eq("filetype", "SE2"))
.add(Restrictions.eq("dirfl","Y"))
.uniqueResult();
when "dirfl" is a property of the joined class Opdir?
|