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
7
votes
3 answers

Maven build problems with spring-data-jpa and querydsl

I've got an Eclipse Maven project for spring-data-jpa and QueryDsl. I seem to have a problem with the maven-apt-plugin where if I do a mvn clean followed by a mvn install, it tries to "process" files that reference the QueryDsl generated files, but…
Alex
  • 483
  • 1
  • 10
  • 21
7
votes
4 answers

Spring boot 3 with queryDSL

How i can to generate Q-classes using queryDSL with Spring Boot 3.0. part of build.gradle: plugins { id 'com.ewerk.gradle.plugins.querydsl' version '1.0.10' } configurations { querydsl.extendsFrom implementation, compileOnly, runtimeOnly,…
Kotamadeo
  • 73
  • 1
  • 3
7
votes
1 answer

How to perform queries on hierarchical entities using querydsl or spring data jpa specification?

I'm having an entity hierarchy like this. Besides some common properties, some properties are shared only by a few subtypes: @Entity @Inheritance(strategy = InheritanceType.JOINED) public class Person { private String firstName; private…
MattDiMu
  • 4,873
  • 1
  • 19
  • 29
7
votes
5 answers

QueryDSL annotation processor and gradle plugin

Cannot understand how to configure build.gradle for using querydsl annotation processor without any jpa/jdo/mongo. I want to use @QueryEntity annotation to generate Q classes so then I will be able to compose dynamic SQL queries using DSL support…
Viktor M.
  • 4,393
  • 9
  • 40
  • 71
7
votes
2 answers

How to add querydsl-mongodb to Spring Boot Gradle 5.6.1 project

I am trying to create dynamic query to a mongo database from spring boot gradle project. My gradle version: 5.6.1 Here is my build.gradle file: plugins { id 'org.springframework.boot' version '2.2.2.RELEASE' id…
Md. Najmul Hasan
  • 605
  • 1
  • 6
  • 19
7
votes
2 answers

Document QueryDSL endpoint with Swagger

I'm using Spring Boot Data, QueryDSL and Swagger. I've define endpoint like this: @GetMapping public ResponseEntity listOfThings( @PageableDefault(size = 20, sort = "uID", direction = Sort.Direction.DESC) final Pageable pageable, …
Marx
  • 804
  • 10
  • 23
7
votes
0 answers

Spring Data Projection with QueryDSL Predicate not working

I am trying to use Spring Data projections with a QueryDsl predicate and when I exceute the query I get a 'java.util.NoSuchElementException'. I've created the projected interface type and then pass then have the declaration in the repository as…
aaronc
  • 83
  • 5
7
votes
1 answer

AnnotationProcessor and dependencies

I'm using gradle / querydsl and JPA 2.1. I would like to generate the querydsl metadata using APT (QEntities). To do that I'm using the gradle-apt-plugin and gradle 4.7 In my project I configured the compileJava option using : compileJava { …
Archange
  • 397
  • 5
  • 21
7
votes
1 answer

NoClassDefFoundError: JavacProcessingEnvironment at runtime after tomcat 8 upgrade

After upgrading a project to spring boot 1.5.9 (spring 4.3 & tomcat 8.5.24) a service that makes use of queryDSL is failing at runtime because it can't find a class from a jdk lib (tools.jar). /Q_742623943_01321512155_128635432.java:1: warning:…
miklesw
  • 724
  • 1
  • 9
  • 25
7
votes
2 answers

Querydsl Like Surprise

I have just dabbled into using Querydsl, and am thoroughly enjoying the improvement it brings to interacting with JPA. One remaining question I have is why do you have to wrap a like parameter with %? Have I improperly configured something?…
TheNorthWes
  • 2,661
  • 19
  • 35
7
votes
3 answers

How to log the sql query generated behind the scene from querydsl using mysemma

Any optimal way to show sql queries which are generated automatically while using querydsl of mysemma, so that these sql queries can be viewed easily and debugging of sql query becomes easy while working on querydsl. For Example :…
InvincibleCoder
  • 123
  • 1
  • 6
7
votes
3 answers

Return substring starting from the N occurrence

How to use this function in QueryDsl in Querying JPA SUBSTRING_INDEX(str,delim,count) Returns the substring from string str before count occurrences of the delimiter delim. UPDATE 1 : After trying @MaciejDobrowolski solution like this : QAcheteur…
Hayi
  • 6,972
  • 26
  • 80
  • 139
7
votes
2 answers

Multicolumn WHERE-IN clause in QueryDSL

I'm new to QueryDSL and would to be able to assemble a query with multiple columns in the WHERE-IN clause, like the following query: selec T1.COL1, T1.COL2, .... T1.COL10 from T1 where (T1.COL1, T1.COL2) IN (select T2.COL1, T2.COL2 from T2 WHERE…
Tamara Aviv
  • 885
  • 1
  • 11
  • 28
7
votes
1 answer

QueryDSL group by hours in a time range

I have the following SQL query to group orders by the order date and hour in a day: select to_char(o.order_date, 'YYYY-MM-DD HH24') order_date_hour, sum(o.quantity) quantity from orders o where o.order_date >= to_date('01.02.2016', 'DD.MM.YYYY') …
Robert M.
  • 1,339
  • 1
  • 12
  • 34
7
votes
0 answers

QueryDSL - query specified join fetching, but the owner of the fetched association was not present in the select list

In my Spring Boot,Data/JPA 2.1/QueryDSL application I have a following entity: @Entity @NamedEntityGraph(name = "graph.CardCategoryLevel", attributeNodes = { @NamedAttributeNode("cardCategory"), @NamedAttributeNode("level") }) @Table(name =…
alexanoid
  • 24,051
  • 54
  • 210
  • 410