I am sending an object from UI. This object is going to be created with a reference to an existing child.
This is simple illustration for this relation.
<
Just use the proxy for the child:
parentEntity.setChild(entityManager.getReference(ChildEntity.class, childId));
The point here is to use EntityManager.getReference:
Get an instance, whose state may be lazily fetched.
Hibernate will create the proxy containing only the id without going to the database.