Spring Boot + Spring Security + Hibernate Configuration Example

You may also like...

Leave a Reply

4 Comments on "Spring Boot + Spring Security + Hibernate Configuration Example"

avatar
  Subscribe  
newest oldest
Notify of
Artur Kovalchuk
Guest
Artur Kovalchuk

Hi, can you tell me about how add to new User() exist role?
What to do if role exist in DB?

Memorynotfound.com
Guest
Memorynotfound.com

You need to make sure your cascading is handled correctly.
This can be configured using the @ManyToMany annotation using the cascade property.
In your situation you’re probably saving a detached entity.
You can merge your entity by using ‘cascade= {CascadeType.MERGE, CascadeType.PERSIST}’

Hope this helps you,
Cheers

Memorynotfound.com
Guest
Memorynotfound.com

You need to make sure your cascading is handled correctly.
This can be configured using the @ManyToMany annotation using the cascade property.
In your situation you’re probably saving a detached entity.
You can merge your entity by using ‘cascade= {CascadeType.MERGE, CascadeType.PERSIST}’

Hope this helps you,
Cheers

Manuel Silva
Guest
Manuel Silva

:)