Key key = ds.put(e);
Entity child1 = new Entity(HasOneToOneParentJPA.class.getSimpleName(), key);
ds.put(child1);
Entity child2 = new Entity(HasOneToOneParentJPA.class.getSimpleName(), key);
ds.put(child2);
HasOneToOneJPA parent = em.find(HasOneToOneJPA.class, key);
Query q = em.createQuery(
"select from " + HasOneToOneParentJPA.class.getName() + " c" + " where parent = :p");
q.setParameter("p", parent);
q.setMaxResults(1);
HasOneToOneParentJPA child = (HasOneToOneParentJPA) q.getSingleResult();