/** * Retrieve the identifier (UUID) of the first referencable ancestor node * * @return the UUID */ public String getUuid() { save(); return uuid; }
/** * Retrieve the JCR path for the Item, relative to the first referencable ancestor * * @return the relative path */ public String getRelativePath() { save(); return relPath; }
@Override public int hashCode() { if (hash == 0) { if (uuid == null) { // try to retrieve uuid save(); } // prefer uuid over path if (uuid != null) { if (relPath == null) { hash = uuid.hashCode(); } else { hash = uuid.hashCode() + relPath.hashCode(); } } else { // no node found hash = -1; } } return hash; }
@Override public void detach() { if (isAttached()) { T object = this.getObject(); if (object != null) { TraceMonitor.release(object); } } detaching = true; save(); super.detach(); detaching = false; }