0 Replies Latest reply on Apr 1, 2002 4:54 PM by Yan Or

    EJB-QL boolean comparison

    Yan Or Newbie

      not sure if this is a bug or i'm doing something wrong.
      i have defined the following EJB-QL in ejb-jar.xml. "express" is defined as a Boolean in the bean class:

      <ejb-ql>
      SELECT OBJECT(o) FROM OrderEJB o
      WHERE o.express = FALSE
      </ejb-ql>

      the generated SQL looks like this and causes the following error from MySQL:

      13:51:33,816 DEBUG [findByPropertyKey] Executing SQL: SELECT t0_o.pk FROM ORDERS t0_o WHERE t0_o.express = false
      13:51:33,966 DEBUG [findByPropertyKey] Find failed
      java.sql.SQLException: Column not found: Unknown column 'false' in 'where clause
      '
      at org.gjt.mm.mysql.MysqlIO.sendCommand(Unknown Source)
      at org.gjt.mm.mysql.MysqlIO.sqlQueryDirect(Unknown Source)
      at org.gjt.mm.mysql.Connection.execSQL(Unknown Source)
      at org.gjt.mm.mysql.PreparedStatement.executeQuery(Unknown Source)
      at org.jboss.resource.adapter.jdbc.local.PreparedStatementInPool.execute
      Query(PreparedStatementInPool.java:862)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCA
      bstractQueryCommand.java:107)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntityCommand.execute(JDBCFind
      EntityCommand.java:44)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.findEntity(JDBCStoreM
      anager.java:389)