question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

why Unexpected gap in ordinal parameter labels [1 -> 4] : [1,4,5]

See original GitHub issue

JPAQuery<QUserTEntity> jpaQuery = (JPAQuery<QUserTEntity>) jpaQueryFactory .from(qUserTEntity).leftJoin(qDeptTEntity) .on(qUserTEntity.deptId.eq(qDeptTEntity.deptId)).where(qUserTEntity.userId.in(1,2,3));

java.lang.IllegalArgumentException: org.hibernate.QueryException: Unexpected gap in ordinal parameter labels [1 -> 4] : [1,4,5] at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:138) ~[hibernate-core-5.4.8.Final.jar:5.4.8.Final] at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1535) ~[hibernate-core-5.4.8.Final.jar:5.4.8.Final] at org.hibernate.query.internal.QueryImpl.list(QueryImpl.java) ~[hibernate-core-5.4.8.Final.jar:5.4.8.Final] at org.hibernate.query.internal.AbstractProducedQuery.getSingleResult(AbstractProducedQuery.java:1574) ~[hibernate-core-5.4.8.Final.jar:5.4.8.Final] at com.querydsl.jpa.impl.AbstractJPAQuery.fetchCount(AbstractJPAQuery.java:82) ~[querydsl-jpa-4.3.1.jar:na]

Why is this so

querydsl version:4.3.1

help me,thanks

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Little0Sheepcommented, Jul 15, 2020

I do these kind of queries all the time. Could you downgrade Hibernate to a slightly lower 5.4.x? I’m still investigating this.

I use idea development tools,multiple modules are introduced in one project

There are two versions of hibernate in this one, one is 5.3.10 and the other is 5.4.15, which runs with errors

I took out the modules inside and downloaded the maven dependencies again, my in query was normal

I currently suspect maven dependency conflict

I’m working on the same version of the project, and the in-condition query is normal

thank you

0reactions
jwgmeligmeylingcommented, Jul 15, 2020

Good luck with your application 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

[HHH-14543] Problem with positional parameters
QueryException: Unexpected gap in ordinal parameter labels [1 -> 3] : [1,3] at org.hibernate.query.internal.ParameterMetadataImpl.
Read more >
Saying position beyond number of declared ordinal parameters
Use index as 0 since the parameter index start from 0 . sessionFactory.getCurrentSession() .createSQLQuery("update table1 set someCounter ...
Read more >
Remember that ordinal parameters are 1-based! - Mkyong.com
Problem. HibernateTemplate code … getHibernateTemplate().find("from Domain d where d.domainName = :domainName", domainName);.
Read more >
org.hibernate.query.internal.ParameterMetadataImpl Maven ...
lastPosition + 1 ) { throw new QueryException( String.format( Locale.ROOT, "Unexpected gap in ordinal parameter labels [%s -> %s] : [%s]", lastPosition, ...
Read more >
Processing of Model Parameters
Description Utilities for processing the parameters of various statistical models. Beyond computing p values, CIs, and other indices for a wide variety of ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found