OK, this is related to my vertex question. But this looks like the brunt of my problem.
In my User object I have a method to remove the ItemUserSignedUpToBringToEvent from its Set collection. I have implemented ItemUserSignedUpToBringToEvent's equals method to compare nodeIds.
contains call returns true, but the call to remove fails. Why???Code:public boolean removeItemSignedUpFor(ItemUserSignedUpToBringToEvent itemSignedUp) { return (itemsSignedUpFor.contains(itemSignedUp) && itemsSignedUpFor.remove(itemSignedUp)); }
Here is my equals and hashcode for the ItemUserSignedUpToBringToEvent
In stepping through code, the Spring Data Neo4J class ManagedFieldAccessorSet remove method is returning false.Code:@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ItemUserSignedUpToBringToEvent signedUpItem = (ItemUserSignedUpToBringToEvent) o; if (nodeId == null) return super.equals(o); return nodeId.equals(signedUpItem.nodeId); } @Override public int hashCode() { return nodeId != null ? nodeId.hashCode() : super.hashCode(); }
ThanksCode:@Override public boolean remove(Object o) { if (delegate.remove(o)) { update(); return true; } return false; }
Mark


Reply With Quote