Lombok

Spring Boot(2.2.X) - Spring Elastic Search(6.8.X) - Different JSONProperty and Field Name

China☆狼群 提交于 2020-07-23 08:20:20
问题 Updated Spring boot to 2.2.X from 2.1.X and elastic search to 6.8.X from 6.3.X . Got mapping exception, to resolve Mapping exception, renamed document variable to myDocument. Now on elasticSearchRepo.SaveAll(objectTosave) value is not persisted in document. Other properties like id, category are present in the document. Is there any way to have different fieldName and jsonProperty? import org.springframework.data.elasticsearch.annotations.Document; import org.springframework.data

Is it possible to add @Builder and @AllArgsConstructor in static inner classes [Lombok]?

孤者浪人 提交于 2020-07-21 05:57:34
问题 Basically, the question is if it is possible to add Lombok's @Builder and @AllArgsConstructor to static inner classes? I tried and it didn't, does anyone knows how to do it, or if it's possible? I used eclipse, Lombok version 1.18.4. The code where this happened is confidential, hence I can only show you a little mask version. error: constructor A in class A cannot be applied to given types; [ERROR] required: Map<String,B>,String,boolean [ERROR] found: no arguments [ERROR] reason: actual and

Is it possible to add @Builder and @AllArgsConstructor in static inner classes [Lombok]?

≯℡__Kan透↙ 提交于 2020-07-21 05:56:09
问题 Basically, the question is if it is possible to add Lombok's @Builder and @AllArgsConstructor to static inner classes? I tried and it didn't, does anyone knows how to do it, or if it's possible? I used eclipse, Lombok version 1.18.4. The code where this happened is confidential, hence I can only show you a little mask version. error: constructor A in class A cannot be applied to given types; [ERROR] required: Map<String,B>,String,boolean [ERROR] found: no arguments [ERROR] reason: actual and

Lombok - java.lang.StackOverflowError: null on toString method

被刻印的时光 ゝ 提交于 2020-07-18 03:54:06
问题 I have two classes Product and Categorie . When I would like to modify the list of products in categorie with categoryRepository.save(c1) as shown in the code below, this error occurs: java.lang.StackOverflowError: null at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:449) ~[na:1.8.0_191] at java.lang.StringBuilder.append(StringBuilder.java:136) ~[na:1.8.0_191] at org.sid.entities.Product.toString(Product.java:12) ~[classes/:na] at java.lang.String.valueOf(String.java:2994

@Valid not working for spring rest controller

戏子无情 提交于 2020-07-10 07:01:09
问题 I have defined a rest endpoint method as: @GetMapping("/get") public ResponseEntity getObject(@Valid MyObject myObject){....} This maps request parameters to MyObject. MyObject is defined as(with lombok, javax.validation annotations): @Value @AllArgsConstructor public class MyObject { @Min(-180) @Max(180) private double x; @Min(-90) @Max(90) private double y; } But validations are not working. Even with values out of prescribed range, request doesn't throw error and goes well. 回答1: I see a

Lombok installation in Spring Tool Suite 4 for Windows

淺唱寂寞╮ 提交于 2020-07-08 03:31:05
问题 To install Lombok on one of my spring boot project on STS 4 in Windows 10 OS, I did the following steps: Added the lombok gradle dependency to build.gradle: compile 'org.projectlombok:lombok' Then to install the jar retrieved from building the above dependancy got a lombok-1.16.16.jar. To compile the jar did a right click on the jar -> Run as Java application. Lombok Installer appeared, but couldn't detect the IDE from the drives. So manually tried searching for the .exe file of STS4 (which I

Java 11 + QueryDSL 4 + Gradle 5 + SpringBoot 2.1- not generating QClasses

随声附和 提交于 2020-07-05 02:45:48
问题 I’m trying to integrate QueryDSL, Gradle and Springboot in versions from title. I added annotationProcessors to gradle but Intellij is still not generating the QClasses. I tried sugesstions from community to use the plugin ‘gradle.plugin.com.ewerk.gradle.plugins:querydsl-plugin’ but this did not help. dependencies{ annotationProcessor("org.projectlombok:lombok:1.18.4") annotationProcessor("com.querydsl:querydsl-apt:4.2.1") annotationProcessor("org.springframework.boot:spring-boot-starter-data

Gradle Swagger CodeGen DefaultGenerator CodegenConfigurator Add Lombok

耗尽温柔 提交于 2020-06-29 05:04:35
问题 I have a swagger and the following build.gradle file buildscript { ext { springBootVersion = '2.1.8.RELEASE' } repositories { maven { url "https://mavenrepo.schwab.com/nexus/content/groups/public" } maven { url "https://mavenrepo.schwab.com/nexus/content/repositories/releases/" } } dependencies { classpath("io.swagger:swagger-codegen:2.4.7") classpath "io.spring.gradle:dependency-management-plugin:1.0.8.RELEASE" classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion

does lombok have side effects on jpa

耗尽温柔 提交于 2020-06-11 16:55:09
问题 I am working on converting a jpa entity to use lombok. The resulting code is the following: @Entity @Table(name = "TEST") @Data @NoArgsConstructor @AllArgsConstructor class Test { ... @Column(name = "FORMATTING") @Enumerated(EnumType.ORDINAL) private FormatType formatType; ... } The resulting error message contains the following Caused by: org.hibernate.HibernateException: Missing column: formatType in TEST I am really not sure what to google here. (I tried pasting everything before

javax validation api not working for pojo validation

牧云@^-^@ 提交于 2020-06-01 05:11:27
问题 I have a POJO class where the class variables are getting injected by @Value annotation. I am trying to validate my class variables using javax validation api & so I have tried @NotNull , @NotEmpty and @NotBlank , but all of them seem not to be validating or throwing any kind of exception even when a blank/null value is present in the application.yml file. Any idea as to how can I validate my POJO here using the javax validation api? PS: I am using lombok to generate my getter/setter. Below