I have a DTO that contains other DTOs and a list of multipart files. I am trying to process that DTO but I can’t seem to be able to read the requst. When creating an example request from Swagger UI, I get the following exception: If I put @RequestBody instead of @ModelAttribute then I get Swagger dependencies: OpenAPI3.0 config: Answer
In the following fragment, is the & a bitwise or logical operator? why? [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 11 months ago. Improve this question In the following fragment, is the & a bitwise or logical operator? why? Answer If you regard booleans as single-bit numbers, then & on booleans
Sort character array using java comparator
Sort a character array lexicographically with an additional condition that all c’s comes before all b’s. This could be done manually but I want to code it via inbuilt sorting using comparators. The code I wrote – Gives output: [a, a, a, a, a, b, c, b, d, r, r]. The c only comes before one of the b’s. If
Upgrade to springboot 2.6.1 with querydsl jpa 5.0.0
I am trying to upgrade my springboot version from 2.3.4 to 2.6.1. I use query dsl with jpa and apt-maven-plugin. My issue is that I can’t no more generate the QClasses when I run maven compile. I noticed that I am no more able to use an older version of querydsl (previous one 4.4.0 and apt-maven-plugin 1.1.3). Now when I
Data from test with @Transactional are persisting between tests
I have a small problem. I have started writing tests for my small project. The project uses SpringBoot, standard JpaRepository from Spring, as a testing framework I am using Spock and for testing the database, I’m using PostgreSQL container from TestContainers. The problem is, that data between tests is being persisted, despite the @Transacional on each of the tests. The
How to restore initial fraction from a big decimal
I have a list of fractions that have to be converted to a bigDecimal first and then converted to a fraction again. I have made two methods: first converts from fraction to bigDecimal and the second does the opposite. However, I have noticed that during the conversion I am losing on some precision, hence I was wondering if there is
How to configure JmsMessagingTemplate to use MappingJackson2MessageConverter
I am looking at using JmsMessagingTemplate instead of JmsTemplate because I would like to use convertSendAndReceive. The messages should be send in JSON format. I am having difficulties convincing JmsMessagingTemplate to use MappingJackson2MessageConverter instead of the SimpleMessageConverter. The documentation seems to indicate that having a bean for MappingJackson2MessageConverter is enough to have it been used. I created a small reproducing
JPA Entity for View containig joins and aliases
I have the following query using which I want to create an entity class for the columns which I am retrieving from the query. How to create an entity class from these columns and what variables are needed to take it in entity class to refer to these columns? Answer View is a virtual table based on the result-set of
Exception in thread main Java
This is my program to print natural numbers from 1 to N^2 in a clockwise spiral. I’m getting the following error This is my program The code works fine for N=2 but starts giving this error for N=3,4 etc. If N=3, the greatest value of arr[i][c2] will be arr[2][2] which falls in the range of a 3×3 matrix. Could someone
How to i compare two lists of different types in Java?
I have two lists: The first list is a list of MyObject which contains an int and a String: The second list is simply a list of strings: I want to compare the list of strings (personList) with string in the list of MyObject (myObjectList) and return a list of id’s with all the matches. So in the examle it