Questions tagged [querydsl]

Querydsl is a framework which enables the construction of type-safe SQL-like queries for multiple backends including JPA, MongoDB and SQL in Java.

Querydsl is a framework which enables the construction of type-safe SQL-like queries for multiple backends including , and in .

Instead of writing queries as inline strings or externalizing them into XML files they are constructed via a fluent API.

1985 questions
14
votes
2 answers

QueryDSL Predicate SetPath.any with multiple conditions

I have a simple entity with one to many relationship @Entity // and other @ stuff public class Member { @Id private Long id; private String name; private List programs; ... } @Entity public class Program { @Id private Long…
Pranjal
  • 796
  • 1
  • 8
  • 24
14
votes
2 answers

Spring Boot+JPA+QueryDSL=OrderSpecifier not found

I have this pom.xml: org.springframework.boot spring-boot-starter-parent 1.3.5.RELEASE
User1
  • 39,458
  • 69
  • 187
  • 265
14
votes
9 answers

Handle optional parameters in QueryDSL

I am using QueryDSL with SpringData. I have Table say, Employee and I have created entity class say, EmployeeEntity I have written following service method public EmployeeEntity getEmployees(String firstName, String lastName) { QEmployeeEntity…
Prashant Shilimkar
  • 8,402
  • 13
  • 54
  • 89
14
votes
1 answer

left join with spring data jpa and querydsl

I am using spring data jpa and querydsl and trapped on how to write simple nice query to left join two tables. Suppose I have an Project entity and a Task entity with OneToMany relationship defined in Project, I would like to do something…
Frey Zheng
  • 171
  • 2
  • 2
  • 8
14
votes
2 answers

QueryDsl - subquery in collection expression

I'm using spring-data-jpa and querydsl (3.2.3) I have a scenario where I'm creating set of predicates based on user filer/input. All of these comes to BooleanExpression. My simplified model looks as following: @Entity public class Invoice { …
wiecia
  • 275
  • 2
  • 3
  • 12
13
votes
4 answers

JPQL / QueryDSL: join subquery and get aliased column

I'm trying to get an average for a count on a groupBy by joining with a subquery. Don't know if that the right way to go at all but I couldn't anything about subqueries other than the mysema doc. Scenario: How many orders per product did a customer…
Pete
  • 10,720
  • 25
  • 94
  • 139
13
votes
4 answers

How to make QueryDSL and Lombok work together

When a method or variable is annotated with Lombok annotation, the maven plugin will complain by processing the source generation for JPA. I get this kind of failure in the console logs: symbol: class __ location: class…
jchrbrt
  • 1,006
  • 1
  • 11
  • 12
13
votes
4 answers

Spring data JPA with Hibernate and Ehcache not working

I'm working on an application using Spring Data JPA with Hibernate and I'm trying to enable second level cache using ehcache. I broke up my application into two projects: CoreDataFacade: where I define data access operations using QueryDSL, Spring…
CharlieG.
  • 173
  • 1
  • 1
  • 11
13
votes
4 answers

Spring JPA deleteInBatch causes StackOverflow

I have a question to deleting Items from db using deleteInBatch. I have an object A having a list of Objects B like: class A { private List ; } The list contains more than 7k elements. So now I have to remove A and all its elements. I tried…
kamil.rak
  • 1,378
  • 1
  • 14
  • 28
13
votes
5 answers

Returning a QueryDSL BooleanExpression that evaluates to true

Say I have CustomerQueryInfo bean with the following properties: String firstName String lastName StatusEnum status I want to perform a "QueryDSL" search using this an object of this type that will return a list of customers List. If…
balteo
  • 23,602
  • 63
  • 219
  • 412
12
votes
2 answers

QueryDSL Generated classes not able to access second level elements for querying

I am using QueryDSL with Spring Data JPA in my Java Project and have Generated files using QueryDSL maven plugin to use the QueryDSL Model classes generated by it. This works great when i use it for one level nested objects, however if i try to…
Abhishek
  • 1,031
  • 4
  • 16
  • 25
12
votes
1 answer

QueryDsl MongoDB - Accessing Deeply Nested Object for Query

I have issues trying to access nested object when using BooleanBuilder. I have read that the default is 2 levels, but for my use case, I need to access 3rd level nested objects. So I have added @QueryInit as pointed out in many other answers. But I…
user1955934
  • 3,185
  • 5
  • 42
  • 68
12
votes
1 answer

What's the latest status of QueryDSL?

It's over a year that we have had a commit for QueryDSL. https://github.com/querydsl/querydsl Shall we consider this project Dead or is it moving to a new group? I guess the old team have no plan to maintain it anymore. New JDKs arrive every 6…
Sani.am
  • 135
  • 2
  • 6
12
votes
4 answers

where IN clause - multi column (querydsl)

I have three integer values of two pairs. I would like to use this as a list of IN in the WHERE clause. (2019, 5) (2019, 6) (2019, 7) I want to use the above two-pair list in a query like this: SELECT * FROM WEEK_REPORT A WHERE …
unilep
  • 313
  • 2
  • 9
12
votes
5 answers

Java 11 + QueryDSL 4 + Gradle 5 + SpringBoot 2.1- not generating QClasses

I’m trying to integrate QueryDSL, Gradle and Springboot in versions from title. I added annotationProcessors to gradle but Intellij is still not generating the QClasses. I tried sugesstions from community to use the plugin…
Siwy
  • 121
  • 1
  • 1
  • 5