title: Hibernate QueryException - Not all named parameters have been set
body: <p>I've updated my project from Spring Boot 1.3.5 to 1.4.0 (Release) but still stuck on Hibernate 4.3.11.Final. Building and Running the Application works fine, but i'm facing some issues when running my integration-tests.</p>
  
  <p>When my test tries to query for a permission ...</p>
  
  <p>Service:</p>
  
  <pre><code>SomePermission permission = permissionRepository.findOne(SomePermission.class, somePermissionId);
  </code></pre>
  
  <p>Repository:</p>
  
  <pre><code>@Query("SELECT permission\n" +
          "FROM Permission permission\n" +
          "WHERE TYPE(permission) = :clazz\n" +
          "AND permission.id = :id")
  &lt;T extends Permission&gt; T findOne(@Param("clazz") Class&lt;T&gt; cls, @Param("id") long id);
  </code></pre>
  
  <p>... Hibernate returns following Exception</p>
  
  <pre><code>java.lang.IllegalArgumentException: org.hibernate.QueryException: Not all named parameters have been set: [clazz] [SELECT permission FROM Permission permission WHERE TYPE(permission) = :clazz AND permission.id = :id]
  at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1750) ~[hibernate-entitymanager-4.3.11.Final.jar:4.3.11.Final]
  at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1677) ~[hibernate-entitymanager-4.3.11.Final.jar:4.3.11.Final]
  at org.hibernate.jpa.internal.QueryImpl.getSingleResult(QueryImpl.java:524) ~[hibernate-entitymanager-4.3.11.Final.jar:4.3.11.Final]
  at org.springframework.data.jpa.repository.query.JpaQueryExecution$SingleEntityExecution.doExecute(JpaQueryExecution.java:206) ~[spring-data-jpa-1.10.2.RELEASE.jar:na]
  at org.springframework.data.jpa.repository.query.JpaQueryExecution.execute(JpaQueryExecution.java:78) ~[spring-data-jpa-1.10.2.RELEASE.jar:na]
  at org.springframework.data.jpa.repository.query.AbstractJpaQuery.doExecute(AbstractJpaQuery.java:102) ~[spring-data-jpa-1.10.2.RELEASE.jar:na]
  at org.springframework.data.jpa.repository.query.AbstractJpaQuery.execute(AbstractJpaQuery.java:92) ~[spring-data-jpa-1.10.2.RELEASE.jar:na]
  at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:482) ~[spring-data-commons-1.12.2.RELEASE.jar:na]
  at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:460) ~[spring-data-commons-1.12.2.RELEASE.jar:na]
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.2.RELEASE.jar:4.3.2.RELEASE]
  at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:61) ~[spring-data-commons-1.12.2.RELEASE.jar:na]
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.2.RELEASE.jar:4.3.2.RELEASE]
  at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) ~[spring-tx-4.3.2.RELEASE.jar:4.3.2.RELEASE]
  at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:280) ~[spring-tx-4.3.2.RELEASE.jar:4.3.2.RELEASE]
  at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) ~[spring-tx-4.3.2.RELEASE.jar:4.3.2.RELEASE]
  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) ~[spring-aop-4.3.2.RELEASE.jar:4.3.2.RELEASE]
  at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136) ~[spring-tx-4.3.2.RELEASE.jar:4.3.2.RELEASE]
  ... 120 common frames omitted
  
  Caused by: org.hibernate.QueryException: Not all named parameters have been set: [clazz] [SELECT permission FROM Permission permission WHERE TYPE(permission) = :clazz AND permission.id = :id]
  at org.hibernate.internal.AbstractQueryImpl.verifyParameters(AbstractQueryImpl.java:401) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
  at org.hibernate.internal.AbstractQueryImpl.verifyParameters(AbstractQueryImpl.java:385) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
  at org.hibernate.internal.QueryImpl.list(QueryImpl.java:99) ~[hibernate-core-4.3.11.Final.jar:4.3.11.Final]
  at org.hibernate.jpa.internal.QueryImpl.list(QueryImpl.java:573) ~[hibernate-entitymanager-4.3.11.Final.jar:4.3.11.Final]
  at org.hibernate.jpa.internal.QueryImpl.getSingleResult(QueryImpl.java:495) ~[hibernate-entitymanager-4.3.11.Final.jar:4.3.11.Final]
  ... 134 common frames omitted
  </code></pre>
  
  <p>Does anybody know why this happens? I've debugged these tests, and both parameters are set...</p>
  
  <p>thx</p>