title: JPA Hibernate Postgres Error - operator does not exist: boolean = integer
body: <p>I am having problem with NamedQuery when project is deployed to tomcat server on Linux machine. I have environment as:</p>
  
  <ol>
  <li>CentOS 6.3</li>
  <li>Postgres 8.4</li>
  <li>JPA 2.1</li>
  <li>Hibernate 3.2.8</li>
  </ol>
  
  <p>NamedQuery is </p>
  
  <pre><code>Select dv FROM DocumentVersion dv where dv.isPublished=false
  </code></pre>
  
  <p>When this query is executed on windows machine, It works fine but when the project is deployed on server with above configuration, the pages display the exception with the following error:</p>
  
  <blockquote>
    <p>ERROR 2015-01-04 22:30:33
    org.hibernate.engine.jdbc.spi.SqlExceptionHelper:146 - ERROR: operator
    does not exist: boolean = integer   Hint: No operator matches the
    given name and argument type(s). You might need to add explicit type
    casts.   Position: 649</p>
  </blockquote>
  
  <p>When I change the query to :</p>
  
  <pre><code>Select dv FROM DocumentVersion dv where dv.isPublished =:isPublished
  </code></pre>
  
  <p>i.e. passing boolean as parameter to NamedQuery, it works fine on both platform. </p>
  
  <p>I want to know if I need to add/update any configuration on linux machine or I am doing something wrong.</p>
  
  <p>Table Schema</p>
  
  <pre><code>CREATE TABLE DocumentVersion (
    id SERIAL NOT NULL,
    uuid varchar(100) NOT NULL,
    displayName varchar(100) NOT NULL,
    fileName varchar(100) NOT NULL,
    fileDescription varchar(255) DEFAULT NULL,
    filePath varchar(2048) DEFAULT NULL,
    mimeType varchar(255) NOT NULL,
    version INTEGER NOT NULL,
    fileSize BIGINT NOT NULL,
    isPublished boolean NOT NULL DEFAULT false,
    PRIMARY KEY (id)
  );
  </code></pre>