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

Spring REST API, custom entity fields in the response

I'm working in a REST API (Java, SpringBoot, QueryDsl...) and I would like to customize the fields that I have in the result. By default I'm obtaining all fields of the entity but the fields that I need depends on the request. This should be…
vcima
  • 421
  • 1
  • 7
  • 20
0
votes
0 answers

Does Query Dsl support jpa projections?

It would be good to be able to use projections with Querydsl and JPA fun findAll(predicate: Predicate): Set OrderView is a projection of my entity Order. I can see from the interface this doesn't look possible but is there a future…
0
votes
1 answer

how do I run querydsl project tests on an M1 Mac?

I am trying to run the test suite for the querydsl project on Github (https://github.com/querydsl/querydsl). After following the instructions to build (I built using the 'all' profile), I installed Docker and docker-compose but am getting an error…
Lisa Dina
  • 1
  • 2
0
votes
1 answer

Failed to initialize JPA EntityManagerFactory: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]

My application runs properly in local environment. But in Docker(of AWS EC2) isn't working. When I docker logs my-spring-image 2021-11-09 11:10:49.793 ERROR 7 --- [ main] o.s.boot.SpringApplication : Application run…
J. Chloe Lee
  • 1
  • 1
  • 2
0
votes
0 answers

How to use QueryDSL with SINGLE_TABLE?

I am using JPA with QueryDSL. Here are my entities with single table inheritance strategy. @Entity @Inheritance(strategy = InheritanceType.SINGLE_TABLE) @DiscriminatorColumn(name = "type") public abstract class Parent { private int parentId; …
Roger
  • 7
  • 3
0
votes
1 answer

Mockito QueryDSL

I have a method that uses queryDSL for query generation. public List getObject() { QEntity entity = QEntity.entity; JPAQueryFactory queryFactory = getJPAQueryFactory(); JPAQuery query = queryFactory …
avi
  • 101
  • 4
  • 13
0
votes
1 answer

How to access cross-field values in QueryDSL QuerydslBinderCustomizer?

How can I access other query parameter values inside QuerydslBinderCustomizer? My goal is to create a departure.between(min, max) binding, that I want to derive from two query params min and max. Problem is that the route.max value is not accessible…
membersound
  • 81,582
  • 193
  • 585
  • 1,120
0
votes
0 answers

QueryDsl Error eq(null) is not allowed. Use isNull(instead)

This is Controller Code @PutMapping @PreAuthorize("hasRole('USER')") @RequestMapping("/update") public ResponseEntity userUpdate(MemberDto memberDto){ memberService.userUpdate(memberDto); return new…
JB P
  • 86
  • 1
  • 10
0
votes
1 answer

Should I fetch join all the entities that are lazily loaded?

I am currently working on a web project using JPA and queryDSL. As far as I know, fetch join is used to reduce the number of SQL sent to DBMS when executing lazy loading. (Since fetch joined entities are included in the persistence context) If so,…
Roger
  • 7
  • 3
0
votes
1 answer

Can define the database name beside the table when using query DSL?

Can we define database beside entity name instead of switch to specific schema each time fetch data in multi-tenant applications? For instance:- QEntity qEntity = QEntity.entity; JPAQueryFactory queryFactory = new…
java dev
  • 313
  • 1
  • 3
  • 12
0
votes
1 answer

How to mock querydsl query?

In my prod code I have the following queryDsl query: Collection myList = new ArrayList<>(); myList.add("blue"); myList.add("green"); myList.add("yellow"); QAnimal qAnimal = QAnimal.animal; return animalRepository.exists( …
Andrei Manolache
  • 766
  • 1
  • 8
  • 17
0
votes
1 answer

Elastic Search / Hibernate Search : how to code xor operator with query DSL API in java?

I'am using hibernate search java API to generate an elastic search query. I have problem to code a xor operator. Typically I wrote : private void applyXorOperator(BooleanPredicateClausesStep boolClausesAppender, …
François F.
  • 229
  • 2
  • 17
0
votes
1 answer

Wrong result metadata when using pagination with Balze-Persistence

When I fetch all results without pagination result is OK but when use pagination appear problem in pagination metadata Page p=PageImpl(result.getResults(), PageRequest.of(pageNo, pageSize), result.getTotal()) p.getTotalElements() // wrong…
java dev
  • 313
  • 1
  • 3
  • 12
0
votes
0 answers

Using Querydsl for filtering operations

I just started learning querydsl. I want to do simple filter operations. I saw that there are 2 different methods to do this. The first one is with bindings using the @QuerydslPredicate annotation, the second one is by creating a custom predicate.…
machaff
  • 1
  • 1
0
votes
1 answer

Filter document on items in an array ElasticSearch using condition AND

I have data: [ { "NAME": "John Doe", "CLASS":[1,10,30] }, { "NAME": "Albert", "CLASS": [1,10,40] }, { "NAME": "XINN", "CLASS": [10,30] }, { "NAME": "UJANG", "CLASS": [1,40] }, { "NAME":…
khairul
  • 33
  • 4