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
2 answers

Writing Complex SQL Queries Using Spring Specificaitons

I'm having a complex SQL query which I want to execute in my Spring boot application. Following is a part of it's JPQL equivalent: SELECT j FROM Job j WHERE ( (?6 = 0L) OR 0L IN (SELECT i12.filterFieldId FROM IjpPublishFilterFields i12…
0
votes
1 answer

How to refresh Spring JPA when data is updated from querydsl directly?

I'm using spring data jpa and querydsl. I don't want to update directly through JPA because I have to submit a complete entity, which introduces an unnecessary query. So, I use querydsl instead: val qRecord =…
Chenhe
  • 924
  • 8
  • 19
0
votes
1 answer

How to count distinct years in Date Spring Query DSL?

when I count distinct years in date by this query List count = queryFactory.select(qTestEntity.createdDate.year().countDistinct()).from(qTestEntity) .fetch(); It gives me an error java.lang.IllegalArgumentException:…
java dev
  • 313
  • 1
  • 3
  • 12
0
votes
1 answer

How to get total average value from subquery average collection using querydsl

I have the next entity: @Entity @Table(name = "search_request_items") public class SearchRequestItem extends LongIdEntity { @Column(name = "date") private Instant date; @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name…
jlemon
  • 95
  • 1
  • 9
0
votes
1 answer

Using HttpClient to perform query count api search Elasticsearch

I am wanting to use httpclient in order to perform a GET /count in elasticsearch to return how many hits there are based on a query search. However, I am stuck on trying to get the value inside of jsonData which contains the following when debugging…
MarkCo
  • 810
  • 2
  • 12
  • 29
0
votes
1 answer

In querydsl, how is a subquery performed in the FROM clause?

I have this query: select gf_storage_zone_type, sum(numObjectPhysicalName) numObjects from ( select gf_storage_zone_type, count(distinct gf_object_physical_name) as numObjectPhysicalName from…
exoding
  • 1
  • 1
0
votes
0 answers

LIKE clause on Map key and value - querydsl

Is there a way to convert given query from @Query annotation to Query DSL? The idea is to search for countries by few first characters of name. While using Hibernate 5.5.6.Final, this query was fine, but today I tried Hibernate 6.0.0.Alpha9 and it…
horvoje
  • 643
  • 6
  • 21
0
votes
1 answer

Can assign Child for Parent in Query DSL?

there QParent, QChild1, and QChild2 I try to use QParent instead of each child. the class that contains all predicates class Filter { private QParent query; public Filter(QParent query) { this.query = query; } …
java dev
  • 313
  • 1
  • 3
  • 12
0
votes
1 answer

QueryDSL and ManyToMany relationships

In a project I have the following entities : templates which have template parts which are connected to keywords. Both of these relationships are @ManyToMany. Some code : @NoArgsConstructor @Getter @Setter @Entity @Table(name = "TEMPLATE") public…
Bruno
  • 63
  • 7
0
votes
0 answers

Aggregation with range and match_phrase

I want to count the total failed logins each day (between 2021-07-18 and 2021-07-26). The query here will return only hits for failed logins between those dates. If I removed the 'match_phrase' component that looks for failed logins, it will count…
HC LW
  • 131
  • 11
0
votes
1 answer

Error creating bean with name 'entityManagerFactory' defined in class path resource and Access denied for user @'localhost' (using password: NO)

I got this error "access denied for user using password=NO" where I already added the right password.please give me solution on this. Here is the stack trace: java.sql.SQLException: Access denied for user 'www.abcom.in'@'localhost' (using password:…
0
votes
1 answer

Elasticsearch filter results by field

I'm new to dsl and this seems simple. The code should count total entries by the hour, within the date range specified. I added a bool such that the results should have a field called 'message' which should contain '[success' GET…
HC LW
  • 131
  • 11
0
votes
1 answer

Elasticsearch COUNT() text fields

This is an extension of this question. The query I'm using, like this is supposed to count the number of entries per hour. GET index_with_text/_search { "size": 0, "query": { "range": { "timestamp": { "gte": "2021-06-15", …
HC LW
  • 131
  • 11
0
votes
0 answers

Hibernate BooleanJunction generics handling

I want to avoid warnings about raw types, but don't know how to. import org.apache.lucene.search.Query; import org.hibernate.search.query.dsl.QueryBuilder; import org.hibernate.search.query.dsl.BooleanJunction; final QueryBuilder queryBuilder =…
horvoje
  • 643
  • 6
  • 21
0
votes
1 answer

How to mock joins in queryDsl (jpa + mockito)?

Given the queryDsl code that selects from entities by joining them @Repository @RequiredArgsConstructor public class BlahRepository { private final JPAQueryFactory jpaQueryFactory; public List getYyzPerById(Long id) { final…
DerBenniAusA
  • 727
  • 1
  • 7
  • 13