* @param nowner the document to which this relation is moved
* */
public void moveTo (Entity nowner) {
- //RKV Session session = Database.getCurSession();
Entity oldOwner = this.owner;
this.owner = nowner;
nowner.getAllRelations().add(this);
oldOwner.getAllRelations().remove(this);
-// myold.getAllRelations().remove(this); Harmful as it leads to remove this relation from the database (!?)
- //RKV session.update(this);
- //RKV session.update(nowner);
if (this.isBidirectional()) {
Relation link = this.getReverse();
link.setTo(nowner);
- //RKV session.update(link);
}
}