javax.persistence.EntityNotFoundException: Unable to find xyz.application.auth.entity.Group with id 6
So the EntityNotFoundException is stating that class "Group" with id 6 was not found... I don't know why this is coming back as an exception but you are getting the right result. Could wrap it in a try-catch, until you find a prettier way.
Since this is a natural id, is it possible to place the constraint with DB rather than in hibernate (as you are currently attempting, if it is not already), in which case you simply try to insert the row and check for success?
|