/** * ADVANCED: * Return the receiver's delete call. * This allows the user to override the delete operation. */ public Call getDeleteCall() { if (getDeleteQuery() == null) { return null; } return getDeleteQuery().getDatasourceCall(); }
/** * ADVANCED: * Return the receiver's delete SQL string. * This allows the user to override the SQL generated by TopLink, with their own SQL or procedure call. * The arguments are translated from the fields of the source row, * through replacing the field names marked by '#' with the values for those fields. * <p> * Example, "delete from EMPLOYEE where EMPLOYEE_ID = #EMPLOYEE_ID". */ public String getDeleteSQLString() { if (getDeleteQuery() == null) { return null; } return getDeleteQuery().getSQLString(); }
/** * Delete the object using the user defined query. * This ensures that the query is cloned and prepared correctly. */ protected void performUserDefinedDelete() { performUserDefinedWrite(getDescriptor().getQueryManager().getDeleteQuery()); }
/** * INTERNAL: * Check to see if a custom query should be used for this query. * This is done before the query is copied and prepared/executed. * null means there is none. */ protected DatabaseQuery checkForCustomQuery(AbstractSession session, AbstractRecord translationRow) { checkDescriptor(session); // check if user defined a custom query DescriptorQueryManager queryManager = getDescriptor().getQueryManager(); if ((!isCallQuery())// this is not a hand-coded (custom SQL, SDK etc.) call &&(!isUserDefined())// and this is not a user-defined query (in the query manager) &&queryManager.hasDeleteQuery()) {// and there is a user-defined query (in the query manager) return queryManager.getDeleteQuery(); } return null; }
manager.setInsertQuery((InsertObjectQuery)getInsertQuery().clone()); if (getDeleteQuery() != null) { manager.setDeleteQuery((DeleteObjectQuery)getDeleteQuery().clone());
getReadObjectQuery().setDescriptor(descriptor); if (getDeleteQuery() != null) { getDeleteQuery().setDescriptor(descriptor);
getDeleteQuery().setModifyRow(new DatabaseRecord());
setDeleteQuery((DeleteObjectQuery)parentQueryManager.getDeleteQuery().clone());