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
9
votes
1 answer

Difficulty combining bool and range query, elastic search

I'm having a bit of trouble understanding the various ways to nest queries in elastic search. Here is an example of what my indexed data looks like.. { "Underlying" : "Eurodollar", "Expiration" : "20160315" }, { "Underlying" :…
Zack
  • 13,454
  • 24
  • 75
  • 113
9
votes
4 answers

Using QueryDSL with MongoDB - java.lang.NoClassDefFoundError

I'm trying to integrate QueryDSL with MongoDB (provided by Spring Data) I'm also using JPA repository, so I separated packages in model module and repository module. Spring Data dependencies are from Spring Data Realease Train version Hopper-SR1.…
Jakub Pomykała
  • 2,082
  • 3
  • 27
  • 58
9
votes
1 answer

JPA predicate with Querydsl

I use Querydsl in my application to greatly improve code for querying database. However, I have a JPA Predicate (javax.persistence.criteria.Predicate) that comes from an external service. I want to mix my query created with Querydsl and the external…
creponutella
  • 173
  • 3
  • 6
9
votes
1 answer

Polymorphic where clause using QueryDsl

I'm trying to use QueryDsl to write a query with a polymorphic where clause. Since it's a little hard to explain what I want to do in the abstract, I cloned the spring-boot-sample-data-jpa project and modified it to show an example of what I'm…
Etienne Neveu
  • 12,604
  • 9
  • 36
  • 59
9
votes
5 answers

@Convert doesn't work with Hibernate and QueryDSL

I have a table Incidencia with a CHAR (1 Byte) column visiblemovil. This column has 2 possible values: "S" or "N" (yes/no, si/no in Spanish) that I want convert to boolean using @Convert annotation. This is my code: Converter: @Converter public…
Héctor
  • 24,444
  • 35
  • 132
  • 243
9
votes
2 answers

Why to use Querydsl?

I am new to JPA, JPQL, Hibernate, Querydsl and now I saw that in my project is used Querydsl for querying and I am wondering why this approach has been chosen. So you can be for sure why exactly is in my project but you can tell why and in what…
Xelian
  • 16,680
  • 25
  • 99
  • 152
9
votes
1 answer

QueryDSL projections with @ManyToOne relation

I'm using OpenJPA with QueryDSL, I try to avoid manipulating Tuple objects by using the bean projections features of QueryDSL. I have for example these two Entity, with a @ManyToOne relation. @Entity public class Folder { private Long id; …
tomahim
  • 1,298
  • 2
  • 11
  • 29
9
votes
1 answer

Overriding Spring-Data-JPA default method annotating with EntityGraph causes QueryException

I'm trying to implement a EntityGraph with Data-JPA, since using QueryDslPredicateExecutor exposes the method findAll(Predicate, Pageable) the one I need, I tried to override it to annotate with @EntityGraph then the troubles began it's throwing…
Joao Evangelista
  • 2,407
  • 2
  • 26
  • 37
9
votes
1 answer

jirutka/rsql-parser and QueryDSL

I have Spring framework created REST services back-end and now I need to find a way to process complex filters in some requests from the front-end. I'm using QueryDsl (v3.4.2) framework to do queries construction throughout the back-end. I think…
elysch
  • 1,846
  • 4
  • 25
  • 43
9
votes
1 answer

How do I build a GenericDao using QueryDSL?

First of, I am really new to QueryDSL. I'm using a Spring + Hibernate environment. The problem I'm facing is with building a GenericDAO to implement all the basic CRUD operations, but I'm not sure how do I get the static reference from a QEntity. My…
9
votes
2 answers

Is there a way to eager fetch a lazy relationship through the Predicate API in QueryDSL?

I am using the QueryDslPredicateExecutor from Spring Data JPA project, and I am facing the need to eager fetch a lazy relation. I know that I can use a native JPA-QL query in the Repository interface, or even used the JPAQLQuery from Query DSL, but…
Angel Villalain
  • 595
  • 4
  • 16
9
votes
3 answers

QueryDSL delete method

I'm using spring-data-mongodb 1.2.0 with QueryDSL 2.9.0. Why doesn't the QueryDslPredicateExecutor have a delete(Predicate predicate) method? Is there a workaround?
Modi
  • 2,200
  • 4
  • 23
  • 37
8
votes
2 answers

How to use order by and Limit in Spring Data JPA using QueryDSL

I am using Spring Data JPA with a RDBMS in my project. I have a requirement where I have to fetch a single record from the Database from a table which has the latest date. For this I need to use a limit and order by function OR using sub queries.…
Abhishek
  • 1,031
  • 4
  • 16
  • 25
8
votes
6 answers

Querydsl Annotation Processor issue after upgrade to Gradle 5

I have a gradle script which generates querydsl classes from Mongo annotated entities. It was working so far, but after upgrade to Gradle 5 I have a problem with: * What went wrong: Execution failed for task…
Michal Plewka
  • 291
  • 1
  • 2
  • 9
8
votes
6 answers

Query DSL & Maven: Classes not generated, but only on command line (in eclipse it is working fine)

We are using a setup with Spring Boot, Hibernate, Query DSL and Maven with Java 1.8 Recently, I've added Query DSL to the project with the configuration listed below. To make it work, I had to configure the Java Compiler in the eclipse project…
ssc-hrep3
  • 15,024
  • 7
  • 48
  • 87