/** * 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 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 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 EclipseLink, 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(); }
/** * ADVANCED: * Return the receiver's delete SQL string. * This allows the user to override the SQL generated by EclipseLink, 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(); }
/** * ADVANCED: * Return the receiver's delete SQL string. * This allows the user to override the SQL generated by EclipseLink, 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(); }
/** * 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 = this.descriptor.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; }
/** * 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 = this.descriptor.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; }
/** * 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 = this.descriptor.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; }
/** * Delete all of the objects with the matching class. */ public void deleteAllObjects(Class theClass, List objects, AbstractSession session) { ClassDescriptor descriptor = null; int size = objects.size(); for (int index = 0; index < size; index++) { Object objectToDelete = objects.get(index); if (objectToDelete.getClass() == theClass) { if (descriptor == null) { descriptor = session.getDescriptor(theClass); } // PERF: Get the descriptor query, to avoid extra query creation. DeleteObjectQuery deleteQuery = descriptor.getQueryManager().getDeleteQuery(); if (deleteQuery == null) { deleteQuery = new DeleteObjectQuery(); deleteQuery.setDescriptor(descriptor); } else { // Ensure original query has been prepared. deleteQuery.checkPrepare(session, deleteQuery.getTranslationRow()); deleteQuery = (DeleteObjectQuery)deleteQuery.clone(); } deleteQuery.setIsExecutionClone(true); deleteQuery.setObject(objectToDelete); session.executeQuery(deleteQuery); } } }
DeleteObjectQuery deleteQuery = descriptor.getQueryManager().getDeleteQuery(); if (deleteQuery == null) { deleteQuery = new DeleteObjectQuery();
DeleteObjectQuery deleteQuery = descriptor.getQueryManager().getDeleteQuery(); if (deleteQuery == null) { deleteQuery = new DeleteObjectQuery();
getReadObjectQuery().setDescriptor(descriptor); if (getDeleteQuery() != null) { getDeleteQuery().setDescriptor(descriptor);
getReadObjectQuery().setDescriptor(descriptor); if (getDeleteQuery() != null) { getDeleteQuery().setDescriptor(descriptor);
getReadObjectQuery().setDescriptor(descriptor); if (getDeleteQuery() != null) { getDeleteQuery().setDescriptor(descriptor);
queryManager.getDeleteQuery().setModifyRow(new DatabaseRecord());
queryManager.getDeleteQuery().setModifyRow(new DatabaseRecord());
setDeleteQuery((DeleteObjectQuery)parentQueryManager.getDeleteQuery().clone());
setDeleteQuery((DeleteObjectQuery)parentQueryManager.getDeleteQuery().clone());
setDeleteQuery((DeleteObjectQuery)parentQueryManager.getDeleteQuery().clone());