net.sf.hibernate.exception.SQLGrammarException: Could not execute query

Hibernate JIRA | Abhishek Khandelwal | 1 decade ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    When Hibernate is configured with postgresql database, the testQuery test of FooBarTest test suites fails The following exception is thrown: ERROR: operator does not exist: boolean = integer at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1471) Here is the stack trace: ========================================================= net.sf.hibernate.exception.SQLGrammarException: Could not execute query at net.sf.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:58) at net.sf.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29) at net.sf.hibernate.impl.SessionImpl.convert(SessionImpl.java:4131) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1557) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1531) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1523) at org.hibernate.test.FooBarTest.testQuery(FooBarTest.java:391) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at org.hibernate.test.TestCase.runTest(TestCase.java:107)Caused by: java.sql.SQLException: ERROR: operator does not exist: boolean = integer at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1471) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1256) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:175) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:389) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:330) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:240) at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:89) at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:880) at net.sf.hibernate.loader.Loader.doQuery(Loader.java:273) at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:138) at net.sf.hibernate.loader.Loader.doList(Loader.java:1063) at net.sf.hibernate.loader.Loader.list(Loader.java:1054) at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:854) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1554) ... 18 more ============================================================.

    Hibernate JIRA | 1 decade ago | Abhishek Khandelwal
    net.sf.hibernate.exception.SQLGrammarException: Could not execute query
  2. 0

    It is the first time that I post an issue. I hope that I have done it in a correct way. I suspect that the problem I am facing is a Hibernate bug. Consider the following problem: A) I have an any-mapping for one class. B) I want to execute an HQL query on that class within a DAO class C) I get an "java.sql.SQLException: ERROR: operator does not exist: record = bigint" -> The details are attached below. A) See the below mapping file for the class: <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping package="ch.blogon.docon.bom.permission.impl" default-lazy="false"> <class name="PermissionImpl" table="PERMISSION" lazy="true"> <!-- Common id property. --> <id name="id" type="long" column="ID"> <generator class="native"/> </id> <!-- A versioned entity. --> <version name="version" column="VERSION" type="integer"/> <!-- Permission holder mapping--> <any name="permissionHolderInternal" id-type="long" meta-type="string"> <meta-value value="USER" class="UserImpl"/> <meta-value value="USER_ROLE" class="UserRoleImpl"/> <meta-value value="WORLD" class="WorldImpl"/> <column name="PERMISSION_HOLDER_TYPE"/> <column name="PERMISSION_HOLDER_ID"/> </any> <!-- workflow activity mapping--> <many-to-one name="workflowActivityInternal" column="WORKFLOW_ACTIVITY_ID" class="ch.blogon.docon.bom.workflow.impl.WorkflowActivityImpl" not-null="true" update="true"/> <!-- status holder mapping--> <any name="workflowStatusHolderInternal" id-type="long" meta-type="string"> <meta-value value="APPLICATION" class="ApplicationImpl"/> <meta-value value="DOCUMENT_SYSTEM_ITEM" class="ch.blogon.docon.bom.docsystem.impl.AbstractDocumentSystemItemImpl"/> <meta-value value="USER" class="UserImpl"/> <meta-value value="USER_ROLE" class="UserRoleImpl"/> <column name="WORKFLOW_STATUS_HOLDER_TYPE"/> <column name="WORKFLOW_STATUS_HOLDER_ID"/> </any> </class> </hibernate-mapping> -> The class has the according getters and setters. A schema export and initialization of data via Java code was already done succesfully. B) I have a DAO implementation which queries on object of this class. I use a static HQL query string within the DAO class: //omitted imports private static final String QUERY_BY_CRITERIA = "from ch.blogon.docon.bom.permission.impl.PermissionImpl as p " + "where p.permissionHolderInternal = :permissionHolder " + "and p.workflowActivityInternal = :workflowActivity " + "and p.workflowStatusHolderInternal = :workflowStatusHolder"; // omitted code public boolean exists(WorkflowStatusHolder obj, WorkflowActivity activity, PermissionHolder holder) { Session session = getSessionFactory().getCurrentSession(); Query query = session.createQuery(QUERY_BY_CRITERIA) .setEntity("permissionHolder", holder) .setEntity("workflowActivity", activity) .setEntity("workflowStatusHolder", obj); return ((query.uniqueResult())!=null); } } C) When I execute the exists method I get the following exception: 1217951 [http-8084-Processor24] DEBUG org.hibernate.util.JDBCExceptionReporter - could not execute query [select permission0_.ID as ID, permission0_.VERSION as VERSION7_, permission0_.PERMISSION_HOLDER_TYPE as PERMISSION3_7_, permission0_.PERMISSION_HOLDER_ID as PERMISSION4_7_, permission0_.WORKFLOW_ACTIVITY_ID as WORKFLOW5_7_, permission0_.WORKFLOW_STATUS_HOLDER_TYPE as WORKFLOW6_7_, permission0_.WORKFLOW_STATUS_HOLDER_ID as WORKFLOW7_7_ from PERMISSION permission0_ where (permission0_.PERMISSION_HOLDER_TYPE, permission0_.PERMISSION_HOLDER_ID)=? and permission0_.WORKFLOW_ACTIVITY_ID=? and (permission0_.WORKFLOW_STATUS_HOLDER_TYPE, permission0_.WORKFLOW_STATUS_HOLDER_ID)=?] java.sql.SQLException: ERROR: operator does not exist: record = bigint at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1471) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1256) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:175) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:389) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:330) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:240) at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:120) at org.hibernate.loader.Loader.getResultSet(Loader.java:1265) at org.hibernate.loader.Loader.doQuery(Loader.java:384) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:211) at org.hibernate.loader.Loader.doList(Loader.java:1588) at org.hibernate.loader.Loader.list(Loader.java:1571) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:395) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:271) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:844) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74) at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:603) at ch.blogon.docon.dao.permission.impl.hibernate.PermissionDAOImpl.exists(PermissionDAOImpl.java:77) at ch.blogon.docon.components.services.impl.PermissionCheckImpl.hasPermission(PermissionCheckImpl.java:82) at ch.blogon.docon.components.interceptors.permission.PermissionCheckBeforeAdvice.before(PermissionCheckBeforeAdvice.java:63) at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:52) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:57) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:80) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174) at $Proxy52.logIn(Unknown Source) at ch.blogon.docon.actionhandler.permission.UserLogInAction.complete(UserLogInAction.java:56) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:138) at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:62) at javax.faces.component.UICommand.broadcast(UICommand.java:106) at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:110) at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:184) at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:271) at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:102) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:109) at org.apache.myfaces.webapp.MyFacesServlet.service(MyFacesServlet.java:70) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:172) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595) When I try to execute the SQL-statement in Postgre it works perfectly fine (after adding values for the placeholders): a) Template SQL: select permission0_.ID as ID, permission0_.VERSION as VERSION7_, permission0_.PERMISSION_HOLDER_TYPE as PERMISSION3_7_, permission0_.PERMISSION_HOLDER_ID as PERMISSION4_7_, permission0_.WORKFLOW_ACTIVITY_ID as WORKFLOW5_7_, permission0_.WORKFLOW_STATUS_HOLDER_TYPE as WORKFLOW6_7_, permission0_.WORKFLOW_STATUS_HOLDER_ID as WORKFLOW7_7_ from PERMISSION permission0_ where (permission0_.PERMISSION_HOLDER_TYPE, permission0_.PERMISSION_HOLDER_ID)=? and permission0_.WORKFLOW_ACTIVITY_ID=? and (permission0_.WORKFLOW_STATUS_HOLDER_TYPE, permission0_.WORKFLOW_STATUS_HOLDER_ID)=? b) SQL-statements with concrete values: select permission0_.ID as ID, permission0_.VERSION as VERSION7_, permission0_.PERMISSION_HOLDER_TYPE as PERMISSION3_7_, permission0_.PERMISSION_HOLDER_ID as PERMISSION4_7_, permission0_.WORKFLOW_ACTIVITY_ID as WORKFLOW5_7_, permission0_.WORKFLOW_STATUS_HOLDER_TYPE as WORKFLOW6_7_, permission0_.WORKFLOW_STATUS_HOLDER_ID as WORKFLOW7_7_ from PERMISSION permission0_ where (permission0_.PERMISSION_HOLDER_TYPE, permission0_.PERMISSION_HOLDER_ID)=('WORLD', 29) and permission0_.WORKFLOW_ACTIVITY_ID=28 and (permission0_.WORKFLOW_STATUS_HOLDER_TYPE, permission0_.WORKFLOW_STATUS_HOLDER_ID)=('APPLICATION', 1) Feedback highly appreciated. Thanks for everything!!!

    Hibernate JIRA | 1 decade ago | Stephan Bloch
    java.sql.SQLException: ERROR: operator does not exist: record = bigint
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    It is the first time that I post an issue. I hope that I have done it in a correct way. I suspect that the problem I am facing is a Hibernate bug. Consider the following problem: A) I have an any-mapping for one class. B) I want to execute an HQL query on that class within a DAO class C) I get an "java.sql.SQLException: ERROR: operator does not exist: record = bigint" -> The details are attached below. A) See the below mapping file for the class: <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping package="ch.blogon.docon.bom.permission.impl" default-lazy="false"> <class name="PermissionImpl" table="PERMISSION" lazy="true"> <!-- Common id property. --> <id name="id" type="long" column="ID"> <generator class="native"/> </id> <!-- A versioned entity. --> <version name="version" column="VERSION" type="integer"/> <!-- Permission holder mapping--> <any name="permissionHolderInternal" id-type="long" meta-type="string"> <meta-value value="USER" class="UserImpl"/> <meta-value value="USER_ROLE" class="UserRoleImpl"/> <meta-value value="WORLD" class="WorldImpl"/> <column name="PERMISSION_HOLDER_TYPE"/> <column name="PERMISSION_HOLDER_ID"/> </any> <!-- workflow activity mapping--> <many-to-one name="workflowActivityInternal" column="WORKFLOW_ACTIVITY_ID" class="ch.blogon.docon.bom.workflow.impl.WorkflowActivityImpl" not-null="true" update="true"/> <!-- status holder mapping--> <any name="workflowStatusHolderInternal" id-type="long" meta-type="string"> <meta-value value="APPLICATION" class="ApplicationImpl"/> <meta-value value="DOCUMENT_SYSTEM_ITEM" class="ch.blogon.docon.bom.docsystem.impl.AbstractDocumentSystemItemImpl"/> <meta-value value="USER" class="UserImpl"/> <meta-value value="USER_ROLE" class="UserRoleImpl"/> <column name="WORKFLOW_STATUS_HOLDER_TYPE"/> <column name="WORKFLOW_STATUS_HOLDER_ID"/> </any> </class> </hibernate-mapping> -> The class has the according getters and setters. A schema export and initialization of data via Java code was already done succesfully. B) I have a DAO implementation which queries on object of this class. I use a static HQL query string within the DAO class: //omitted imports private static final String QUERY_BY_CRITERIA = "from ch.blogon.docon.bom.permission.impl.PermissionImpl as p " + "where p.permissionHolderInternal = :permissionHolder " + "and p.workflowActivityInternal = :workflowActivity " + "and p.workflowStatusHolderInternal = :workflowStatusHolder"; // omitted code public boolean exists(WorkflowStatusHolder obj, WorkflowActivity activity, PermissionHolder holder) { Session session = getSessionFactory().getCurrentSession(); Query query = session.createQuery(QUERY_BY_CRITERIA) .setEntity("permissionHolder", holder) .setEntity("workflowActivity", activity) .setEntity("workflowStatusHolder", obj); return ((query.uniqueResult())!=null); } } C) When I execute the exists method I get the following exception: 1217951 [http-8084-Processor24] DEBUG org.hibernate.util.JDBCExceptionReporter - could not execute query [select permission0_.ID as ID, permission0_.VERSION as VERSION7_, permission0_.PERMISSION_HOLDER_TYPE as PERMISSION3_7_, permission0_.PERMISSION_HOLDER_ID as PERMISSION4_7_, permission0_.WORKFLOW_ACTIVITY_ID as WORKFLOW5_7_, permission0_.WORKFLOW_STATUS_HOLDER_TYPE as WORKFLOW6_7_, permission0_.WORKFLOW_STATUS_HOLDER_ID as WORKFLOW7_7_ from PERMISSION permission0_ where (permission0_.PERMISSION_HOLDER_TYPE, permission0_.PERMISSION_HOLDER_ID)=? and permission0_.WORKFLOW_ACTIVITY_ID=? and (permission0_.WORKFLOW_STATUS_HOLDER_TYPE, permission0_.WORKFLOW_STATUS_HOLDER_ID)=?] java.sql.SQLException: ERROR: operator does not exist: record = bigint at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1471) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1256) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:175) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:389) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:330) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:240) at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:120) at org.hibernate.loader.Loader.getResultSet(Loader.java:1265) at org.hibernate.loader.Loader.doQuery(Loader.java:384) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:211) at org.hibernate.loader.Loader.doList(Loader.java:1588) at org.hibernate.loader.Loader.list(Loader.java:1571) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:395) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:271) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:844) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74) at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:603) at ch.blogon.docon.dao.permission.impl.hibernate.PermissionDAOImpl.exists(PermissionDAOImpl.java:77) at ch.blogon.docon.components.services.impl.PermissionCheckImpl.hasPermission(PermissionCheckImpl.java:82) at ch.blogon.docon.components.interceptors.permission.PermissionCheckBeforeAdvice.before(PermissionCheckBeforeAdvice.java:63) at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:52) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:57) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144) at org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(AbstractTraceInterceptor.java:80) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174) at $Proxy52.logIn(Unknown Source) at ch.blogon.docon.actionhandler.permission.UserLogInAction.complete(UserLogInAction.java:56) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:138) at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:62) at javax.faces.component.UICommand.broadcast(UICommand.java:106) at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:110) at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:184) at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:271) at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:102) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:109) at org.apache.myfaces.webapp.MyFacesServlet.service(MyFacesServlet.java:70) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:172) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:738) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595) When I try to execute the SQL-statement in Postgre it works perfectly fine (after adding values for the placeholders): a) Template SQL: select permission0_.ID as ID, permission0_.VERSION as VERSION7_, permission0_.PERMISSION_HOLDER_TYPE as PERMISSION3_7_, permission0_.PERMISSION_HOLDER_ID as PERMISSION4_7_, permission0_.WORKFLOW_ACTIVITY_ID as WORKFLOW5_7_, permission0_.WORKFLOW_STATUS_HOLDER_TYPE as WORKFLOW6_7_, permission0_.WORKFLOW_STATUS_HOLDER_ID as WORKFLOW7_7_ from PERMISSION permission0_ where (permission0_.PERMISSION_HOLDER_TYPE, permission0_.PERMISSION_HOLDER_ID)=? and permission0_.WORKFLOW_ACTIVITY_ID=? and (permission0_.WORKFLOW_STATUS_HOLDER_TYPE, permission0_.WORKFLOW_STATUS_HOLDER_ID)=? b) SQL-statements with concrete values: select permission0_.ID as ID, permission0_.VERSION as VERSION7_, permission0_.PERMISSION_HOLDER_TYPE as PERMISSION3_7_, permission0_.PERMISSION_HOLDER_ID as PERMISSION4_7_, permission0_.WORKFLOW_ACTIVITY_ID as WORKFLOW5_7_, permission0_.WORKFLOW_STATUS_HOLDER_TYPE as WORKFLOW6_7_, permission0_.WORKFLOW_STATUS_HOLDER_ID as WORKFLOW7_7_ from PERMISSION permission0_ where (permission0_.PERMISSION_HOLDER_TYPE, permission0_.PERMISSION_HOLDER_ID)=('WORLD', 29) and permission0_.WORKFLOW_ACTIVITY_ID=28 and (permission0_.WORKFLOW_STATUS_HOLDER_TYPE, permission0_.WORKFLOW_STATUS_HOLDER_ID)=('APPLICATION', 1) Feedback highly appreciated. Thanks for everything!!!

    Hibernate JIRA | 1 decade ago | Stephan Bloch
    java.sql.SQLException: ERROR: operator does not exist: record = bigint
  5. 0

    Calling a procedure in postgresql using JDBC

    Oracle Community | 1 decade ago | 843859
    java.sql.SQLException: ERROR: syntax error at or near "$1"

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.sql.SQLException

      ERROR: operator does not exist: boolean = integer

      at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse()
    2. PostgreSQL JDBC Driver
      AbstractJdbc2Statement.executeQuery
      1. org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1471)
      2. org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1256)
      3. org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:175)
      4. org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:389)
      5. org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:330)
      6. org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:240)
      6 frames
    3. net.sf.hibernate
      SessionImpl.find
      1. net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:89)
      2. net.sf.hibernate.loader.Loader.getResultSet(Loader.java:880)
      3. net.sf.hibernate.loader.Loader.doQuery(Loader.java:273)
      4. net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:138)
      5. net.sf.hibernate.loader.Loader.doList(Loader.java:1063)
      6. net.sf.hibernate.loader.Loader.list(Loader.java:1054)
      7. net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:854)
      8. net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1554)
      9. net.sf.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:58)
      10. net.sf.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
      11. net.sf.hibernate.impl.SessionImpl.convert(SessionImpl.java:4131)
      12. net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1557)
      13. net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1531)
      14. net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1523)
      14 frames
    4. org.hibernate.test
      FooBarTest.testQuery
      1. org.hibernate.test.FooBarTest.testQuery(FooBarTest.java:391)
      1 frame
    5. Java RT
      DelegatingMethodAccessorImpl.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      3 frames
    6. org.hibernate.test
      TestCase.runTest
      1. org.hibernate.test.TestCase.runTest(TestCase.java:107)
      1 frame