Skip to content

Tag: spring

Getters and setters for List in Spring boot

I am creating my API in Spring Boot. I have that a product is composed of components: Here is my code: (Entity Layer) } My Question: In the controller class should I change the update method to be as follows, to have the following code, product.addProduct(myComponent) or should I have it as follows: product.s…

How to use @ConfigurationProperties with Records?

Java 16 introduced Records, which help to reduce boilerplate code when writing classes that carry immutable data. When I try to use a Record as @ConfigurationProperties bean as follows I get the following error message: How can I use Records as @ConfigurationProperties? Answer Answering my own question. The a…

Kafka Consumer with JSON?

is it possible to use Kafka as getting a JSON objects from a post HTTP request putting them into topic and then sending them to Consumer(Database)? BTW here is my KafkaConfig class: Answer I assume you know how to create a post REST point with a spring project. Basically after you get the json input from your…

Detached entity passed to persist java spring

So i have a big error when trying to do an update method in my spring application ,the problem is regarding to the Caracter class as thats the one the seems to generate it. When i set my stuff in main and try to update an Anime object in the database the Caracter class gives me the errors presented below