@Override public boolean equals(final Object o) { if (this == o) { return true; } else if (o instanceof AttachedEntityId) { AttachedEntityId that = (AttachedEntityId)o; return identity.equals(that.identity); } else if (o instanceof EntityId) { EntityId that = (EntityId)o; return getValue().equals(that.getValue()); } return false; }
if (bucketId.equals(indexEntry.getKey().getKeys().get(BUCKET_KEY_ID))) { assets.add(assetStore.getById(indexEntry.getValue()));
/** * Associates a {@link BrowseNode} with the given {@link Component}. */ public void createComponentNode(final ODatabaseDocumentTx db, final String repositoryName, final List<String> path, final Component component) { BrowseNode node = newNode(repositoryName, path); ODocument document = findNodeRecord(db, node); if (document == null) { // complete the new entity before persisting node.setComponentId(EntityHelper.id(component)); addEntity(db, node); } else { ORID oldComponentId = document.field(P_COMPONENT_ID, ORID.class); ORID newComponentId = componentEntityAdapter.recordIdentity(component); if (oldComponentId == null) { // shortcut: merge new information directly into existing record document.field(P_COMPONENT_ID, newComponentId); document.save(); } else if (!oldComponentId.equals(newComponentId)) { // retry in case this is due to an out-of-order delete event throw new BrowseNodeCollisionException("Node already has a component"); } } }
document.save(); else if (!oldAssetId.equals(newAssetId)) {