@Override public int hashCode() { int hash = 7; hash = 47 * hash + this.id; hash = 47 * hash + this.getID(); hash = 47 * hash + this.getDSpaceObject().getID().hashCode(); return hash; }
@Override public void update(Context context, MetadataValue metadataValue, boolean updateLastModified) throws SQLException, AuthorizeException { if (updateLastModified) { authorizeService.authorizeAction(context, metadataValue.getDSpaceObject(), Constants.WRITE); DSpaceObjectService<DSpaceObject> dSpaceObjectService = contentServiceFactory .getDSpaceObjectService(metadataValue.getDSpaceObject()); // get the right class for our dspaceobject not the DSpaceObject lazy proxy DSpaceObject dso = dSpaceObjectService.find(context, metadataValue.getDSpaceObject().getID()); dSpaceObjectService.updateLastModified(context, dso); } update(context, metadataValue); }
/** * Return <code>true</code> if <code>other</code> is the same MetadataValue * as this object, <code>false</code> otherwise * * @param obj object to compare to * @return <code>true</code> if object passed in represents the same * MetadataValue as this object */ @Override public boolean equals(Object obj) { if (obj == null) { return false; } Class<?> objClass = HibernateProxyHelper.getClassWithoutInitializingProxy(obj); if (getClass() != objClass) { return false; } final MetadataValue other = (MetadataValue) obj; if (this.id != other.id) { return false; } if (this.getID() != other.getID()) { return false; } if (this.getDSpaceObject().getID() != other.getDSpaceObject().getID()) { return false; } return true; }