コード例 #1
0
    @Override
    public void addChild(Location parent, Location newChild) {
      if (this.manager != null) {
        parent.getChildLocations().add(newChild);
        newChild.setParentLocation(parent);

        manager.persistLocation(newChild);
      }
    }
コード例 #2
0
    @Override
    public boolean removeChild(Location child) {
      if (child.getParentLocation() != null && manager != null) {
        child.getParentLocation().getChildLocations().remove(child);
        child.setParentLocation(null);

        manager.cascadeDeleteLocation(child.getId());

        return true;
      }

      return false;
    }
コード例 #3
0
    @Override
    public boolean moveChild(Location child, Location newParent) {
      if (manager == null) return false;

      return manager.moveLocation(child, newParent);
    }