Skip to content

Check Opposite Exists IN CoreDataObject Remove #129

@plasma-framework

Description

@plasma-framework

public void remove() {
final String thisKey = ((PlasmaNode) this).getUUIDAsString();
if (log.isDebugEnabled())
log.debug("removing " + thisKey);

List<Property> properties = this.getType().getProperties();
for (Property property : properties) {
  if (!property.getType().isDataType()) {
    Property targetProperty = property.getOpposite();
    if (!targetProperty.isMany()) {
      DataObject target = this.getDataObject(targetProperty);
      if (target != null) {
        if (log.isDebugEnabled())
          log.debug("removing " + ((PlasmaNode) this).getUUIDAsString() + " from "
              + property.getName() + "->" + ((PlasmaNode) target).getUUIDAsString());
        target.unset(targetProperty);
      }

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions