querydsl

Spring JPA QuerydslPredicate Snake Case

空扰寡人 提交于 2021-02-18 18:32:47
问题 I am using spring boot with Query DSL. I have configured my spring boot to use snake case i.e. spring.jackson.property-naming-strategy=SNAKE_CASE . So my json payload input and output is in snake case like below { "first_name": "First", "last_name": "Last" } I am using @QuerydslPredicate for my search functionality. If I enter query params in snake case like below (http://localhost:8080/context/resource/?first_name=First) it is not parsed by Query DSL Predicate. However, If I provide the

Spring JPA QuerydslPredicate Snake Case

假装没事ソ 提交于 2021-02-18 18:31:32
问题 I am using spring boot with Query DSL. I have configured my spring boot to use snake case i.e. spring.jackson.property-naming-strategy=SNAKE_CASE . So my json payload input and output is in snake case like below { "first_name": "First", "last_name": "Last" } I am using @QuerydslPredicate for my search functionality. If I enter query params in snake case like below (http://localhost:8080/context/resource/?first_name=First) it is not parsed by Query DSL Predicate. However, If I provide the

Spring JPA QuerydslPredicate Snake Case

孤街浪徒 提交于 2021-02-18 18:31:23
问题 I am using spring boot with Query DSL. I have configured my spring boot to use snake case i.e. spring.jackson.property-naming-strategy=SNAKE_CASE . So my json payload input and output is in snake case like below { "first_name": "First", "last_name": "Last" } I am using @QuerydslPredicate for my search functionality. If I enter query params in snake case like below (http://localhost:8080/context/resource/?first_name=First) it is not parsed by Query DSL Predicate. However, If I provide the

Java QueryDsl code generation does not generate Q class

我们两清 提交于 2021-02-11 12:19:06
问题 I'm making a Spring project, where i'm using QueryDsl for the entities. I'm picking up this project from a few months back, where i already had 1 generated class (QUser). Now i made a new entity called Permission, and modified the User entity. When i'm building the project, the QUser doesn't change, and the QPermission class is not generating either. What am i doing wrong? Here's the entity and pom.xml for QueryDsl. @Entity @Table(name = "permission") public class Permission { @Id

QUERY DSL target classes are cleaned every time I do a code change

故事扮演 提交于 2021-02-11 09:58:53
问题 generated Qclasses in the target directory is always get cleaned when I do a small code change and save.Therefore I have to do maven updates to generate QClasses every time. Is there a better approach without having to update maven every time? 回答1: Issue solved by rolling back to version 1.1.2 of maven apt plugin from version 1.1.3 回答2: 3 years after you answered yourself (thank you btw) I'm experiencing this exact same issue too with STS and the apt-maven-plugin. Unfortunately 1.1.3 is still

QUERY DSL target classes are cleaned every time I do a code change

…衆ロ難τιáo~ 提交于 2021-02-11 09:58:33
问题 generated Qclasses in the target directory is always get cleaned when I do a small code change and save.Therefore I have to do maven updates to generate QClasses every time. Is there a better approach without having to update maven every time? 回答1: Issue solved by rolling back to version 1.1.2 of maven apt plugin from version 1.1.3 回答2: 3 years after you answered yourself (thank you btw) I'm experiencing this exact same issue too with STS and the apt-maven-plugin. Unfortunately 1.1.3 is still

How to sort by querydsl alias

一笑奈何 提交于 2021-02-07 03:53:29
问题 Is there a way to sort repository query results by querydsl alias? So far I've managed to filter, but sorting results with an error: org.springframework.data.mapping.PropertyReferenceException: No property username found for type User! request: GET /users?size=1&sort=username,desc my rest controller method: @GetMapping("/users") public ListResult<User> getUsersInGroup( @ApiIgnore @QuerydslPredicate(root = User.class) Predicate predicate, Pageable pageable) { Page<User> usersInGroup =

How to sort by querydsl alias

主宰稳场 提交于 2021-02-07 03:51:40
问题 Is there a way to sort repository query results by querydsl alias? So far I've managed to filter, but sorting results with an error: org.springframework.data.mapping.PropertyReferenceException: No property username found for type User! request: GET /users?size=1&sort=username,desc my rest controller method: @GetMapping("/users") public ListResult<User> getUsersInGroup( @ApiIgnore @QuerydslPredicate(root = User.class) Predicate predicate, Pageable pageable) { Page<User> usersInGroup =

How to sort by querydsl alias

与世无争的帅哥 提交于 2021-02-07 03:51:18
问题 Is there a way to sort repository query results by querydsl alias? So far I've managed to filter, but sorting results with an error: org.springframework.data.mapping.PropertyReferenceException: No property username found for type User! request: GET /users?size=1&sort=username,desc my rest controller method: @GetMapping("/users") public ListResult<User> getUsersInGroup( @ApiIgnore @QuerydslPredicate(root = User.class) Predicate predicate, Pageable pageable) { Page<User> usersInGroup =

NullPointerException on QueryDSL where clause

有些话、适合烂在心里 提交于 2021-01-28 03:08:07
问题 Using Query DSL with hibernate (Spring Data JPA) to build a query like so if( bankId != null ){ query.where( coopMember.personId.bankAccountId.isNotNull().and( coopMember.personId.bankAccountId.bankBranch.bankId.eq(bankId)) ); } return query.fetch(); The logic here is simple: if there is a bank account associated with a person, filter the results by bank id. The BankAccount entity has a BankBranch which holds bankId integer value. A CoopMember entity may or may not have a BankAccount Problem