Olá a todos,
Tenho o seguinte método:
public List<Shelf> getShelvesByCollaboratorAndShelfModel(Collaborator collaborator, ShelfModel model) {
Criteria criteria = getDaoGeneric().getSession().createCriteria(Shelf.class);
criteria.add(Expression.in("city", collaborator.getCitys()));
criteria.add(Expression.eq("shelfModel", model));
criteria.addOrder(Order.asc("name"));
return criteria.list();
}
Antes quando tinha o PostgreSQL rodava normalmente, migrei para o oracle, porém quando executo vem o erro abaixo, notei que quando comento a linha que tem o Expressions.in o problema nao ocorre, vejam o erro
Jun 21, 2010 6:01:51 PM org.hibernate.util.JDBCExceptionReporter logExceptions
WARNING: SQL Error: 936, SQLState: 42000
Jun 21, 2010 6:01:51 PM org.hibernate.util.JDBCExceptionReporter logExceptions
SEVERE: ORA-00936: missing expression
Exception in thread "main" org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.doList(Loader.java:2223)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
at org.hibernate.loader.Loader.list(Loader.java:2099)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:94)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1569)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)
at br.com.gvt.seaccess.dao.DaoShelf.getShelvByDateInsertAndCollaborator(DaoShelf.java:113)
at br.com.gvt.seaccess.shelfinventory.inventory.Inventory.sendEmailByCollaborator(Inventory.java:178)
at br.com.gvt.seaccess.shelfinventory.inventory.Inventory.makeInventory(Inventory.java:171)
at shelfinventory.Main.main(Main.java:56)
Caused by: java.sql.SQLException: ORA-00936: missing expression
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:316)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:282)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:639)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:185)
at oracle.jdbc.driver.T4CPreparedStatement.execute_for_describe(T4CPreparedStatement.java:503)
at oracle.jdbc.driver.OracleStatement.execute_maybe_describe(OracleStatement.java:965)
at oracle.jdbc.driver.T4CPreparedStatement.execute_maybe_describe(T4CPreparedStatement.java:535)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1051)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2984)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3026)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1787)
at org.hibernate.loader.Loader.doQuery(Loader.java:674)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
at org.hibernate.loader.Loader.doList(Loader.java:2220)
... 9 more
Java Result: 1
Alguem sabe o que acontece?