Spring Boot + Spring Security + Hibernate Configuration Example

You may also like...

4
Leave a Reply

avatar
2 Comment threads
2 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
3 Comment authors
Manuel SilvaMemorynotfound.comArtur Kovalchuk Recent comment authors
  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

:)