@Override public int hashCode() { int hash = 5; hash += 71 * hash + getType(); hash += 71 * hash + getID().hashCode(); return hash; }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } Class<?> objClass = HibernateProxyHelper.getClassWithoutInitializingProxy(obj); if (this.getClass() != objClass) { return false; } final Bundle other = (Bundle) obj; if (this.getType() != other.getType()) { return false; } if (!this.getID().equals(other.getID())) { return false; } return true; }
@Override public void update(Context context, Bundle bundle) throws SQLException, AuthorizeException { // Check authorisation //AuthorizeManager.authorizeAction(ourContext, this, Constants.WRITE); log.info(LogManager.getHeader(context, "update_bundle", "bundle_id=" + bundle.getID())); super.update(context, bundle); bundleDAO.save(context, bundle); if (bundle.isModified() || bundle.isMetadataModified()) { if (bundle.isMetadataModified()) { context.addEvent(new Event(Event.MODIFY_METADATA, bundle.getType(), bundle.getID(), bundle.getDetails(), getIdentifiers(context, bundle))); } context.addEvent(new Event(Event.MODIFY, Constants.BUNDLE, bundle.getID(), null, getIdentifiers(context, bundle))); bundle.clearModified(); bundle.clearDetails(); } }