/** * 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; }
if (!queryManager.hasDeleteQuery()) { XQueryInteraction call = new XQueryInteraction(); call.setXQueryString(queryString);
if (!queryManager.hasDeleteQuery()) {
if (!queryManager.hasDeleteQuery()) {
setUpdateQuery((UpdateObjectQuery)parentQueryManager.getUpdateQuery().clone()); if ((!hasDeleteQuery()) && (parentQueryManager.hasDeleteQuery())) { setDeleteQuery((DeleteObjectQuery)parentQueryManager.getDeleteQuery().clone());
setUpdateQuery((UpdateObjectQuery)parentQueryManager.getUpdateQuery().clone()); if ((!hasDeleteQuery()) && (parentQueryManager.hasDeleteQuery())) { setDeleteQuery((DeleteObjectQuery)parentQueryManager.getDeleteQuery().clone());
setUpdateQuery((UpdateObjectQuery)parentQueryManager.getUpdateQuery().clone()); if ((!hasDeleteQuery()) && (parentQueryManager.hasDeleteQuery())) { setDeleteQuery((DeleteObjectQuery)parentQueryManager.getDeleteQuery().clone());
if (!queryManager.hasDeleteQuery()) { MappedInteraction call = new MappedInteraction(); call.setProperty(MongoPlatform.OPERATION, MongoOperation.REMOVE);
method.addLine("descriptor.getQueryManager().setUpdateCall(updateCall);"); if (descriptor.getQueryManager().hasDeleteQuery() && descriptor.getQueryManager().getDeleteQuery().isSQLCallQuery()) { method.addLine("descriptor.getQueryManager().setDeleteSQLString(\"" + constructValidSQLorEJBQLLinesForJavaSource(descriptor.getQueryManager().getDeleteQuery().getSQLString()) + "\");"); } else if (descriptor.getQueryManager().hasDeleteQuery() && descriptor.getQueryManager().getUpdateQuery().getDatasourceCall() instanceof XMLInteraction) { addXMLInteractionLines(method, (XMLInteraction)descriptor.getQueryManager().getDeleteQuery().getDatasourceCall(), "deleteCall"); method.addLine("descriptor.getQueryManager().setDeleteCall(deleteCall);");
method.addLine("descriptor.getQueryManager().setUpdateCall(updateCall);"); if (descriptor.getQueryManager().hasDeleteQuery() && descriptor.getQueryManager().getDeleteQuery().isSQLCallQuery()) { method.addLine("descriptor.getQueryManager().setDeleteSQLString(\"" + constructValidSQLorEJBQLLinesForJavaSource(descriptor.getQueryManager().getDeleteQuery().getSQLString()) + "\");"); } else if (descriptor.getQueryManager().hasDeleteQuery() && descriptor.getQueryManager().getUpdateQuery().getDatasourceCall() instanceof XMLInteraction) { addXMLInteractionLines(method, (XMLInteraction)descriptor.getQueryManager().getDeleteQuery().getDatasourceCall(), "deleteCall"); method.addLine("descriptor.getQueryManager().setDeleteCall(deleteCall);");
method.addLine("descriptor.getQueryManager().setUpdateCall(updateCall);"); if (descriptor.getQueryManager().hasDeleteQuery() && descriptor.getQueryManager().getDeleteQuery().isSQLCallQuery()) { method.addLine("descriptor.getQueryManager().setDeleteSQLString(\"" + constructValidSQLorEJBQLLinesForJavaSource(descriptor.getQueryManager().getDeleteQuery().getSQLString()) + "\");"); } else if (descriptor.getQueryManager().hasDeleteQuery() && descriptor.getQueryManager().getUpdateQuery().getDatasourceCall() instanceof XMLInteraction) { addXMLInteractionLines(method, (XMLInteraction)descriptor.getQueryManager().getDeleteQuery().getDatasourceCall(), "deleteCall"); method.addLine("descriptor.getQueryManager().setDeleteCall(deleteCall);");