i try too save Provider, which have a Set of Address, but it return Server Error.
i try too save Provider, which have a Set of Address, but it return Server Error. enter image description here enter image description here
i try too save Provider, which have a Set of Address, but it return Server Error.
i try too save Provider, which have a Set of Address, but it return Server Error. enter image description here enter image description here
If the server error looks like this:
object references an unsaved transient instance - save the transient instance before flushing
You should have something like this in the Address class:
@OneToMany(
mappedBy = "provider",
orphanRemoval = true,
cascade = CascadeType.ALL)
private Set<Address> addresses = new HashSet<>();
This may help: https://stackoverflow.com/a/2302814/5902295
If it's not that error, you could edit your post and add a screenshot.
I think while saving provider you are not getting address that's why it's showing EntityNotFoundException.
You can try with fetch = FetchType.EAGER
in your address mapping so it will fetch addresses immediately.