public void onCollectionRecreate(Object collection, Serializable key) throws CallbackException { debug("Intercepted collection recreate."); }
public void onCollectionRemove(Object collection, Serializable key) throws CallbackException { debug("Intercepted collection remove."); }
/** default logic */ public void onDelete(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) throws CallbackException { debug("Intercepted delete."); EMPTY.onDelete(entity, id, state, propertyNames, types); }
/** * default logic, but we may want to use them eventually for * dependency-injection. */ public Object instantiate(String entityName, EntityMode entityMode, Serializable id) throws CallbackException { debug("Intercepted instantiate."); return EMPTY.instantiate(entityName, entityMode, id); }
/** default logic */ public int[] findDirty(Object entity, Serializable id, Object[] currentState, Object[] previousState, String[] propertyNames, Type[] types) { debug("Intercepted dirty check."); return EMPTY.findDirty(entity, id, currentState, previousState, propertyNames, types); }
public void preFlush(Iterator entities) throws CallbackException { debug("Intercepted preFlush."); EMPTY.preFlush(entities); }
public void postFlush(Iterator entities) throws CallbackException { debug("Intercepted postFlush."); if (TransactionSynchronizationManager.isCurrentTransactionReadOnly()) { debug("detected read-only transaction"); } else if (sqlAction != null) { /* read-write transactions may trigger checks */ debug("updating current light administrator privileges"); final Set<AdminPrivilege> privileges = currentUser.current().getCurrentAdminPrivileges(); sqlAction.deleteCurrentAdminPrivileges(); if (CollectionUtils.isNotEmpty(privileges)) { sqlAction.insertCurrentAdminPrivileges(privileges); } } }
/** default logic. */ public boolean onLoad(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) throws CallbackException { debug("Intercepted load."); this.stats.loadedObjects(1); return EMPTY.onLoad(entity, id, state, propertyNames, types); }
/** * calls back to {@link BasicSecuritySystem#newTransientDetails(IObject)} for * properly setting {@link IObject#getDetails() Details} */ public boolean onSave(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) { debug("Intercepted save."); this.stats.updatedObjects(1); if (entity instanceof IObject) { IObject iobj = (IObject) entity; int idx = HibernateUtils.detailsIndex(propertyNames); Details d = evaluateLinkages(iobj); // Get a new details based on the current context d = newTransientDetails(iobj, d); state[idx] = d; } return true; // transferDetails ALWAYS edits the new entity. }
public void onCollectionUpdate(Object collection, Serializable key) throws CallbackException { debug("Intercepted collection update."); if (collection instanceof PersistentList) { PersistentList list = (PersistentList) collection;
Object[] currentState, Object[] previousState, String[] propertyNames, Type[] types) { debug("Intercepted update."); this.stats.updatedObjects(1); boolean altered = false;