Hibernate version:2.1.4
Mapping documents:n-a
Code between sessionFactory.openSession() and session.close():n-a
Full stack trace of any exception that occurs:n-a
Name and version of the database you are using:Oracle 9i
Debug level Hibernate log excerpt: n-a
Ok, I want to made this query with Criteria method :
Code:
select mx.status, bs.status from bs, mx
WHERE bs.EXTERNAL_REF_ID = mx.NETDEALID (+)
AND (bs.status in ('error')
OR mx.status in ('inSystem'));
I have a one-to-one relation between bs and mx
Is it possible ?
Here my actual code that does not working :
Code:
Criteria criteria = session.createCriteria(Bs.class);
(...)
criteria.add(
Expression.or(
Expression.in("status", bsStatuses.toArray()),
Expression.in("mx.status", mxStatuses.toArray())
)
);
The exception is :
Code:
net.sf.hibernate.QueryException: could not resolve property: mx.status of: com.bp.eqd.msl.eai.monitoring.Bs
at net.sf.hibernate.persister.AbstractPropertyMapping.toColumns(AbstractPropertyMapping.java:50)
at net.sf.hibernate.expression.AbstractCriterion.getColumns(AbstractCriterion.java:35)
at net.sf.hibernate.expression.InExpression.toSqlString(InExpression.java:36)
at net.sf.hibernate.expression.LogicalExpression.toSqlString(LogicalExpression.java:44)
at net.sf.hibernate.loader.CriteriaLoader.<init>(CriteriaLoader.java:68)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:3592)
at net.sf.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:245)
Thx,
-emmanuel