JPA specification is clear
Embeddables cannot be queried, persisted, merged independently of their parent object. They are strictly privately-owned (dependent) objects
You should use carefully because its lifespan is bounded by the lifespan of the owning entity instance. So if you persist/merge/remove your owning entity instance, all of its embeddables instances will be persisted/merged/removed
Suppose you do something like
/**
* Let's suppose owning contains SIX embeddables instances
*/
Owning owning = manager.find(Owining.class, owningId);
So your modify just your Owning entity at view layer and submit your changes. You retrieve your Owning entity by using
/**
* Usually your web framework Takes care of binding your submitted data
*/
Owning owning = new Owning();
owning.setProperty(request.getParameter("property"));
Then you can merge your submitted data and you Think your embeddables instances are stored in database yet. Well, let's see
As shown above you (or your web framework) just retrieved Owning properties, right ??? So your owning.getElementList() is empty. Because owning.getElementList() is empty, JPA will remove all of its embeddables instances. Keep this in mind.
Usually an embeddable class does not have relationship with other than its Owning Entity. And when using a Set of embeddables, JPA always select before saving/updating because it needs to compare one by one by using its equals method. So you need a consistent equals implementation when using a Set collection.
Here you can see its counterpart in Hibernate.