/** * Initialize the aggregate query with the settings from the source query. */ protected void buildAggregateModifyQuery(ObjectLevelModifyQuery sourceQuery, ObjectLevelModifyQuery aggregateQuery, Object sourceAttributeValue) { if (sourceQuery.getSession().isUnitOfWork()) { Object backupAttributeValue = getAttributeValueFromBackupClone(sourceQuery.getBackupClone()); if (backupAttributeValue == null) { backupAttributeValue = getObjectBuilder(sourceAttributeValue, sourceQuery.getSession()).buildNewInstance(); } aggregateQuery.setBackupClone(backupAttributeValue); } aggregateQuery.setCascadePolicy(sourceQuery.getCascadePolicy()); aggregateQuery.setObject(sourceAttributeValue); aggregateQuery.setTranslationRow(sourceQuery.getTranslationRow()); aggregateQuery.setSession(sourceQuery.getSession()); aggregateQuery.setProperties(sourceQuery.getProperties()); }
/** * Initialize the aggregate query with the settings from the source query. */ protected void buildAggregateModifyQuery(ObjectLevelModifyQuery sourceQuery, ObjectLevelModifyQuery aggregateQuery, Object sourceAttributeValue) { // If we are map key mapping we can't build a backupAttributeValue // from a back up clone since a map key mapping does not map a field // on the source queries backup clone. if (sourceQuery.getSession().isUnitOfWork() && ! isMapKeyMapping()) { Object backupAttributeValue = getAttributeValueFromBackupClone(sourceQuery.getBackupClone()); if (backupAttributeValue == null) { backupAttributeValue = getObjectBuilder(sourceAttributeValue, sourceQuery.getSession()).buildNewInstance(); } aggregateQuery.setBackupClone(backupAttributeValue); } aggregateQuery.setCascadePolicy(sourceQuery.getCascadePolicy()); aggregateQuery.setObject(sourceAttributeValue); aggregateQuery.setTranslationRow(sourceQuery.getTranslationRow()); aggregateQuery.setSession(sourceQuery.getSession()); aggregateQuery.setProperties(sourceQuery.getProperties()); }
/** * Initialize the aggregate query with the settings from the source query. */ protected void buildAggregateModifyQuery(ObjectLevelModifyQuery sourceQuery, ObjectLevelModifyQuery aggregateQuery, Object sourceAttributeValue) { // If we are map key mapping we can't build a backupAttributeValue // from a back up clone since a map key mapping does not map a field // on the source queries backup clone. if (sourceQuery.getSession().isUnitOfWork() && ! isMapKeyMapping()) { Object backupAttributeValue = getAttributeValueFromBackupClone(sourceQuery.getBackupClone()); if (backupAttributeValue == null) { backupAttributeValue = getObjectBuilder(sourceAttributeValue, sourceQuery.getSession()).buildNewInstance(); } aggregateQuery.setBackupClone(backupAttributeValue); } aggregateQuery.setCascadePolicy(sourceQuery.getCascadePolicy()); aggregateQuery.setObject(sourceAttributeValue); aggregateQuery.setTranslationRow(sourceQuery.getTranslationRow()); aggregateQuery.setSession(sourceQuery.getSession()); aggregateQuery.setProperties(sourceQuery.getProperties()); }