I am having problem with NamedQuery when project is deployed to tomcat server on Linux machine. I have environment as:
- CentOS 6.3
- Postgres 8.4
- JPA 2.1
- Hibernate 3.2.8
NamedQuery is
Select dv FROM DocumentVersion dv where dv.isPublished=false
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:
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
When I change the query to :
Select dv FROM DocumentVersion dv where dv.isPublished =:isPublished
i.e. passing boolean as parameter to NamedQuery, it works fine on both platform.
I want to know if I need to add/update any configuration on linux machine or I am doing something wrong.
Table Schema
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)
);