Skip to content
Advertisement

Tag: spring-boot

Is Spring Integration a good framework to implement the Transactional Outbox pattern? [closed]

Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 9 months ago. Improve this question I’m implementing Transactional Outbox pattern using Java. The Message Relay Service will poll the Outbox table for entries, and after an

mapper does not convert between dto to entity

I am new to mapsturct I just want to map between dto to entity those two; my bank class; my bank dto class; my mapper below; Answer Target and source properties don’t work well with collections mapping. You need additional mapping for single element. Update your mapper as below, so Mapstruct can use element mapper when mapping the collection: If

Springboot 2.5.6 gives java.time.temporal.UnsupportedTemporalTypeException: Unsupported field: OffsetSeconds issues

Since migration to springboot 2.5.6 I have to register our ObjectMapper with JavaTimeModule. However, I am getting the below error for the format “yyyy-MM-dd’T’HH:mm:ss.SSSZ”. How can I fix it? The input time that we get is something like 2020-07-01T10:00:00.000+0000 Error Our Serialization Answer LocalDateTime does not support timezones by definition. Therefore it doesn’t support OffsetSeconds. You should leave off the

Deleting an entity with one to one relation

My two entities have one to one relation I tried to delete my user entity by this method PasswordResetTokenRepository class which method I called in my service method, for deleting user I used regular hibernate method deleteById(Long id) But when I try to delete by this method I got this error: not-null property references a null or transient value :

Using Optionals correctly in service layer of spring boot application

I new to spring boot application development. I using service layer in my application, but came across the repository method that return Optional as shown below. My question is , whether I am using the Optional correctly here. And is it ok to check this optional (isPresent()) in the RestController and throughing exception is not present.Like below Answer I wouldn’t

Return link from Hateos

I have this old Spring Hateos code which I want to migrate to the latest version: I tried this: I get error at this line: Can you advise what is the correct way to implement this? Answer Based on your comments & question for migration this is what I am suggesting: …. //calling addLinlk And inside addLink: Tested with Java

Advertisement