public void preUpdateWithChanges(DescriptorEvent event) { if (event.getQuery() instanceof UpdateObjectQuery) { UpdateObjectQuery query = (UpdateObjectQuery) event.getQuery(); for (ChangeRecord cr : query.getObjectChangeSet().getChanges()) { String clazz = query.getObject().getClass().getSimpleName(); Object id = query.getObjectChangeSet().getId(); Object newValue = PropertyUtils.getProperty(query.getObject(), cr.getAttribute()); Object oldVal = cr.getOldValue(); } }
/** * INTERNAL: * Set the properties needed to be cascaded into the custom query. */ protected void prepareCustomQuery(DatabaseQuery customQuery) { UpdateObjectQuery customUpdateQuery = (UpdateObjectQuery)customQuery; customUpdateQuery.setObject(getObject()); customUpdateQuery.setObjectChangeSet(getObjectChangeSet()); customUpdateQuery.setCascadePolicy(getCascadePolicy()); customUpdateQuery.setShouldMaintainCache(shouldMaintainCache()); customUpdateQuery.setModifyRow(null); }
/** * INTERNAL: * Set the properties needed to be cascaded into the custom query. */ protected void prepareCustomQuery(DatabaseQuery customQuery) { UpdateObjectQuery customUpdateQuery = (UpdateObjectQuery)customQuery; customUpdateQuery.setObject(getObject()); customUpdateQuery.setObjectChangeSet(getObjectChangeSet()); customUpdateQuery.setCascadePolicy(getCascadePolicy()); customUpdateQuery.setShouldMaintainCache(shouldMaintainCache()); customUpdateQuery.setModifyRow(null); }
/** * INTERNAL: * Set the properties needed to be cascaded into the custom query. */ protected void prepareCustomQuery(DatabaseQuery customQuery) { UpdateObjectQuery customUpdateQuery = (UpdateObjectQuery)customQuery; customUpdateQuery.setObject(getObject()); customUpdateQuery.setObjectChangeSet(getObjectChangeSet()); customUpdateQuery.setCascadePolicy(getCascadePolicy()); customUpdateQuery.setShouldMaintainCache(shouldMaintainCache()); customUpdateQuery.setModifyRow(null); }