title: Spring JPA Repository - Caused by: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
body: <p>I have a Repository and hitting directly this repository from Postman.</p>
  
  <pre><code>Caused by: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
      at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:63)
      at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)
      at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:111)
      at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:97)
      at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:79)
      at org.hibernate.loader.Loader.getResultSet(Loader.java:2115)
      at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1898)
      at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1874)
      at org.hibernate.loader.Loader.doQuery(Loader.java:919)
      at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:336)
      at org.hibernate.loader.Loader.doList(Loader.java:2610)
      at org.hibernate.loader.Loader.doList(Loader.java:2593)
      at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2422)
      at org.hibernate.loader.Loader.list(Loader.java:2417)
      at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:336)
      at org.hibernate.internal.SessionImpl.listCustomQuery(SessionImpl.java:1980)
      at org.hibernate.internal.AbstractSessionImpl.list(AbstractSessionImpl.java:322)
      at org.hibernate.internal.SQLQueryImpl.list(SQLQueryImpl.java:125)
      at org.hibernate.jpa.internal.QueryImpl.list(QueryImpl.java:606)
      at org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:483)
      at org.springframework.data.jpa.repository.query.JpaQueryExecution$CollectionExecution.doExecute(JpaQueryExecution.java:114)
      at org.springframework.data.jpa.repository.query.JpaQueryExecution.execute(JpaQueryExecution.java:78)
      at org.springframework.data.jpa.repository.query.AbstractJpaQuery.doExecute(AbstractJpaQuery.java:102)
      at org.springframework.data.jpa.repository.query.AbstractJpaQuery.execute(AbstractJpaQuery.java:92)
      at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:482)
      at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:460)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:61)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
      at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
      at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136)
      ... 98 common frames omitted
  Caused by: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=RCON411.PROJECT, DRIVER=4.11.69
      at com.ibm.db2.jcc.am.gd.a(gd.java:676)
      at com.ibm.db2.jcc.am.gd.a(gd.java:60)
      at com.ibm.db2.jcc.am.gd.a(gd.java:127)
      at com.ibm.db2.jcc.am.jn.c(jn.java:2561)
      at com.ibm.db2.jcc.am.jn.d(jn.java:2549)
      at com.ibm.db2.jcc.am.jn.a(jn.java:2025)
      at com.ibm.db2.jcc.am.kn.a(kn.java:6836)
      at com.ibm.db2.jcc.t4.cb.g(cb.java:140)
      at com.ibm.db2.jcc.t4.cb.a(cb.java:40)
      at com.ibm.db2.jcc.t4.q.a(q.java:32)
      at com.ibm.db2.jcc.t4.rb.i(rb.java:135)
      at com.ibm.db2.jcc.am.jn.ib(jn.java:1996)
      at com.ibm.db2.jcc.am.kn.sc(kn.java:3058)
      at com.ibm.db2.jcc.am.kn.b(kn.java:3841)
      at com.ibm.db2.jcc.am.kn.fc(kn.java:702)
      at com.ibm.db2.jcc.am.kn.executeQuery(kn.java:672)
      at org.apache.tomcat.dbcp.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:82)
      at org.apache.tomcat.dbcp.dbcp2.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:82)
      at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:70)
      ... 127 common frames omitted
  </code></pre>
  
  <p>Project class is</p>
  
  <pre><code>@Data @Entity @Table(name = "PROJECT", schema = "DCS") public class Project implements Identifiable&lt;Integer&gt; {
      @Id
      @Column(name = "PRJ_I", nullable = false)
      private Integer id;
  
      @Column(name = "PRJ_NM")
      private String projectName;
  
      @OneToOne
      @JoinColumn(name="PRJ_I")
      private CcpaCustomerProjectGroup ccpaCustomerProjectGroup;
  }
  </code></pre>
  
  <p>CcpaCustomerProjectGroup is</p>
  
  <pre><code>@Data @Entity @Table(name = "CCPA_CUS_PRJ_GRP", schema = "DCS") public class CcpaCustomerProjectGroup implements Identifiable&lt;Integer&gt; {
      @Id
      @Column(name="CCPA_CUS_PRJ_GRP_I")
      private Integer id;
  
      @Column(name="CUS_PRJ_GRP_I")
      private Integer customerProjectGroupId;
  
      @Column(name="PRJ_I")
      private Integer projectId;
  
      /*@OneToOne
      @PrimaryKeyJoinColumn
      private Project project;*/
  }
  </code></pre>
  
  <p>ProjectRepository is</p>
  
  <pre><code>public interface ProjectRepository extends JpaRepository&lt;Project, Integer&gt;,JpaSpecificationExecutor&lt;Project&gt;, QueryDslPredicateExecutor&lt;Project&gt; {
  
      @Query(value="select p.PRJ_I,p.PRJ_NM from CCPA_CUS_PRJ_GRP c,project p where c.CUS_PRJ_GRP_I = ?1 and c.PRJ_I = p.PRJ_I and p.PRJ_NM like ?2", nativeQuery = true)
      List&lt;Project&gt; find(@Param("clientId") Integer clientId, @Param("projectName") String projectName);
  
  }
  </code></pre>