I have a complicated data model with which I use QueryDSL regularly. However, one of the cases is failing because of an invalid SQL query being generated. I have been unable to determine if it is Spring Data, QueryDSL or Hibernate that is generating the invalid query.
A sample project is available on Github demonstrating the problem. The problem is triggered by the following code:
@Entity
@QueryEntity
class Person {
private String firstName;
private String lastName;
private String middleName;
}
QPerson person = QPerson.person;
BooleanExpression query = person.firstName.concat(" ")
.concat(person.middleName.concat(" ").coalesce(""))
.concat(person.lastName)
.containsIgnoreCase(name);
This kind of a query works in some cases but doesn't in others. In the sample project, PersonRepositoryTest passes with this query, but QuotationRepositoryTest fails due to an invalid SQL query with the same QueryDSL code
Manish opened DATAJPA-1216 and commented
I have a complicated data model with which I use QueryDSL regularly. However, one of the cases is failing because of an invalid SQL query being generated. I have been unable to determine if it is Spring Data, QueryDSL or Hibernate that is generating the invalid query.
A sample project is available on Github demonstrating the problem. The problem is triggered by the following code:
This kind of a query works in some cases but doesn't in others. In the sample project,
PersonRepositoryTest
passes with this query, butQuotationRepositoryTest
fails due to an invalid SQL query with the same QueryDSL codeAffects: 1.11.8 (Ingalls SR8)
Reference URL: https://github.com/manish-in-java/spring-jpa-querydsl-bug