У меня была аналогичная проблема, которую я решил, вызвав сеттер владельца. 2 метода, устанавливающие и добавляющие детей в TestObj, должны быть изменены таким образом, чтобы TestObj инициализировался со стороны владельца:
public synchronized void setChildren(Set<Children> children)
{
this.children = children;
for(Children child : children)
{
// initializing the TestObj instance in Children class (Owner side) so that it is not a null and PK can be created
child.setTestObj(this);
}
}
Второй метод:
public void addChildren(Children child)
{
children.add(child);
//Intializing the TestObj instance at the owner side
child.setTestObj(this);
}
Я полагаю, это то же самое, что HTTP использует протокол TCP.