1 Reply Latest reply on Mar 21, 2006 1:09 AM by Andrew

    Seam + hibernate query substitution error

    Andrew Apprentice

      Not sure if this is due to hibernate or seam using hibernate.

      The error:
      org.postgresql.util.PSQLException: ERROR: operator does not exist: boolean = integer

      The stack trace:

      Caused by: org.postgresql.util.PSQLException: ERROR: operator does not exist: boolean = integer
       at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1512)
       at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1297)
       at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)
       at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:437)
       at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:353)
       at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:257)
       at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:236)
       at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:139)
       at org.hibernate.loader.Loader.getResultSet(Loader.java:1669)
       at org.hibernate.loader.Loader.doQuery(Loader.java:662)
       at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
       at org.hibernate.loader.Loader.doList(Loader.java:2145)
       ... 162 more
      


      persistence.xml in my META-INF directory of my jar:
      <persistence>
       <persistence-unit name="entityManager" transaction-type="RESOURCE_LOCAL">
       <provider>org.hibernate.ejb.HibernatePersistence</provider>
       <jta-data-source>java:/myDatasource</jta-data-source>
       <properties>
       <property name="hibernate.dialect"
       value="org.hibernate.dialect.PostgreSQLDialect" />
       <property name="connection.release_mode">after_statement</property>
       <property name="hibernate.default_schema">public</property>
       <property name="hibernate.transaction.manager_lookup_class"
       value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
       <property name="hibernate.transaction.flush_before_completion" value="true"/>
       <property name="hibernate.show_sql" value="true"/>
       <property name="hibernate.query.substitutions">true 1, false 0</property>
       <property name="jboss.entity.manager.factory.jndi.name"
       value="java:/myEntityManagerFactory"/>
       </properties>
       </persistence-unit>
      </persistence>
      


      EBQL code:
      conferences = (List<? extends Conference>)entityManager.createQuery(
       "select c from Conference c " +
       "where c.active = true " +
       "and c.start >= current_date() " +
       "order by c.start")
       .getResultList();
      


      table def:
      create table conference (
       id integer not null,
       start_d date not null,
       end_d date not null,
       description text not null,
       name varchar(250) not null,
       active boolean not null
      );
      


      Thanks for any help,
      Andrew