My Dto model My main model My mapstruct class Hi everyone my project using mapstruct but my dto class user_id not mapping user please help me Thanks Answer This should solve the problem: Because you’re wanting to map user_id from CoverLetterDto to the User class in CoverLetter, you have to use dot notat…
Tag: spring-boot
Can not insert null object on One to One relation Spring boot | nested exception is .PersistentObjectException: detached entity passed to persist
This is the relation And postman Object Data I can not insert null value .If I give the AllOrgMstOrganizationId then no problem.But when I give it Null Then Error::org.springframework.dao.InvalidDataAccessApiUsageException: detached entity passed to persist: com.hrms.entity.com.AllOrgMst; nested exception is …
How to make a custom message from an already defined response on Spring
My API is returning me this: The problem is, I would like to, on the array that is represented by the second ID, return a error message, as there is no data in it. Something like this: My code is as follows: With this, I can’t seem to override the specific response, as it is an List of the Entity(Health…
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘messageSender’
Error while trying to publish a message from spring boot to Google cloud platform pub/sub. I was trying to publish a message to the Google Cloud Platform pub/sub messaging queue. I was getting the following errors while trying to run the application.Please help. I was using only a single Java Class file. Thea…
@Retryable with @Scheduled don’t fire
I’ve written a Spring Boot Application where I’ve enabled Spring Batch Scheduling and Retriable as follow: I’ve defined a controller as follow: After 2 minutes, as the cron expression specified starts the job, so in the first step of it I’ll send it in exception so in the job execution…
Hibernate adds unwanted unique key itself In @OneToMany mapping
I have 3 entities in my Spring boot application. User,Item and Orders I want one Orders object to have multiple Items so, I used @OneToMany mapping in Orders class. This is my code: This is my Item.java file This is my Orders.java file Hibernate is generating 3 tables as I expected Item , Orders and Orders_It…
Spring Boot Docker Native image of Spring R2DBC application on Java 16 fails on unsupported methdod
I have a simple application built on top of org.springframework.boot:spring-boot-starter-parent version 2.5.4-SNAPSHOT and some derived dependencies: org.springframework.boot:spring-boot-starter-data-r2dbc org.springframework.boot:spring-boot-starter-webflux org.springframework.boot:spring-boot-starter-actuat…
Apache Ignite 2.11.0 :: Missing ignite-spring-tx-ext in maven repository
We are trying to upgrading from 2.9.1 to 2.11.0 and we have already using org.apache.ignite.transactions.spring.SpringTransactionManager which is now not available in core lib, when we checked docs https://ignite.apache.org/docs/latest/extensions-and-integrations/spring/spring-tx#maven-configuration its sugge…
Spring Boot 2 Multiple Datasource – work only the one with @Primay annotation
I have a problem, I’m trying to use two Oracle databases in spring boot using DataSource, The DataSource wiht the @Primay annotation works fine but the oher one only gives me: I don’t have idea what I should do now. Any help will be welcomed. Thanks! application.properties pom.xml DatabaseConfigur…
Java Spring Boot – how to seed a database like in PHP Laravel
I’m trying to learn Java Spring Boot. I’m coming from PHP Laravel and the one thing I miss about the framework is how easy it is to make database seeders and factories etc. I’m trying to figure out a way where I can seed my h2 db so that every time the application does a hot reload it will c…