/** * ADVANCED: * Return the receiver's update call. * This allows the user to override the update operation. */ public Call getUpdateCall() { if (getUpdateQuery() == null) { return null; } return getUpdateQuery().getDatasourceCall(); }
/** * ADVANCED: * Return the receiver's update call. * This allows the user to override the update operation. */ public Call getUpdateCall() { if (getUpdateQuery() == null) { return null; } return getUpdateQuery().getDatasourceCall(); }
/** * ADVANCED: * Return the receiver's update call. * This allows the user to override the update operation. */ public Call getUpdateCall() { if (getUpdateQuery() == null) { return null; } return getUpdateQuery().getDatasourceCall(); }
/** * ADVANCED: * Return the receiver's update SQL string. * This allows the user to override the SQL generated by EclipseLink, with there 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. * This must check the optimistic lock field and raise an error on optimistic lock failure. * <p> * Example, "update EMPLOYEE set F_NAME to #F_NAME, L_NAME to #L_NAME where EMPLOYEE_ID = #EMPLOYEE_ID". */ public String getUpdateSQLString() { if (getUpdateQuery() == null) { return null; } return getUpdateQuery().getSQLString(); }
/** * ADVANCED: * Return the receiver's update SQL string. * This allows the user to override the SQL generated by EclipseLink, with there 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. * This must check the optimistic lock field and raise an error on optimistic lock failure. * <p> * Example, "update EMPLOYEE set F_NAME to #F_NAME, L_NAME to #L_NAME where EMPLOYEE_ID = #EMPLOYEE_ID". */ public String getUpdateSQLString() { if (getUpdateQuery() == null) { return null; } return getUpdateQuery().getSQLString(); }
/** * ADVANCED: * Return the receiver's update SQL string. * This allows the user to override the SQL generated by EclipseLink, with there 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. * This must check the optimistic lock field and raise an error on optimistic lock failure. * <p> * Example, "update EMPLOYEE set F_NAME to #F_NAME, L_NAME to #L_NAME where EMPLOYEE_ID = #EMPLOYEE_ID". */ public String getUpdateSQLString() { if (getUpdateQuery() == null) { return null; } return getUpdateQuery().getSQLString(); }
/** * Update the object using the user defined query. * This ensures that the query is cloned and prepared correctly. */ protected void performUserDefinedUpdate() { performUserDefinedWrite(getDescriptor().getQueryManager().getUpdateQuery()); }
/** * Update the object using the user defined query. * This ensures that the query is cloned and prepared correctly. */ protected void performUserDefinedUpdate() { performUserDefinedWrite(getDescriptor().getQueryManager().getUpdateQuery()); }
/** * Update the object using the user defined query. * This ensures that the query is cloned and prepared correctly. */ protected void performUserDefinedUpdate() { performUserDefinedWrite(getDescriptor().getQueryManager().getUpdateQuery()); }
/** * 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.hasUpdateQuery()) {// and there is a user-defined query (in the query manager) return queryManager.getUpdateQuery(); } 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.hasUpdateQuery()) {// and there is a user-defined query (in the query manager) return queryManager.getUpdateQuery(); } 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.hasUpdateQuery()) {// and there is a user-defined query (in the query manager) return queryManager.getUpdateQuery(); } return null; }
/** * Update the foreign key fields when resolving a bi-directional reference in a UOW. * This is rare to occur for non-relational, however if it does each of the calls must be re-executed. */ protected void updateForeignKeyFieldAfterInsert(WriteObjectQuery writeQuery) { writeQuery.setModifyRow(this.getDescriptor().getObjectBuilder().buildRow(writeQuery.getObject(), this.getSession(), WriteType.INSERT)); // For CR 2923 must move to session we will execute call on now // so correct DatasourcePlatform used by translate. AbstractSession sessionToUse = this.query.getExecutionSession(); // yes - this is a bit ugly... Vector calls = ((DatasourceCallQueryMechanism)this.getDescriptor().getQueryManager().getUpdateQuery().getQueryMechanism()).getCalls(); for (Enumeration stream = calls.elements(); stream.hasMoreElements();) { DatasourceCall call = (DatasourceCall)((DatasourceCall)stream.nextElement()).clone(); call.setQuery(writeQuery); sessionToUse.executeCall(call, this.getTranslationRow(), writeQuery); } } }
/** * Update the foreign key fields when resolving a bi-directional reference in a UOW. * This is rare to occur for non-relational, however if it does each of the calls must be re-executed. */ protected void updateForeignKeyFieldAfterInsert(WriteObjectQuery writeQuery) { writeQuery.setModifyRow(this.getDescriptor().getObjectBuilder().buildRow(writeQuery.getObject(), this.getSession(), WriteType.INSERT)); // For CR 2923 must move to session we will execute call on now // so correct DatasourcePlatform used by translate. AbstractSession sessionToUse = this.query.getExecutionSession(); // yes - this is a bit ugly... Vector calls = ((DatasourceCallQueryMechanism)this.getDescriptor().getQueryManager().getUpdateQuery().getQueryMechanism()).getCalls(); for (Enumeration stream = calls.elements(); stream.hasMoreElements();) { DatasourceCall call = (DatasourceCall)((DatasourceCall)stream.nextElement()).clone(); call.setQuery(writeQuery); sessionToUse.executeCall(call, this.getTranslationRow(), writeQuery); } } }
/** * Update the foreign key fields when resolving a bi-directonal reference in a UOW. * This is rare to occur for non-relational, however if it does each of the calls must be re-executed. */ protected void updateForeignKeyFieldAfterInsert(WriteObjectQuery writeQuery) { writeQuery.setModifyRow(this.getDescriptor().getObjectBuilder().buildRow(writeQuery.getObject(), this.getSession())); // For CR 2923 must move to session we will execute call on now // so correct DatasourcePlatform used by translate. AbstractSession sessionToUse = this.query.getExecutionSession(); // yes - this is a bit ugly... Vector calls = ((DatasourceCallQueryMechanism)this.getDescriptor().getQueryManager().getUpdateQuery().getQueryMechanism()).getCalls(); for (Enumeration stream = calls.elements(); stream.hasMoreElements();) { DatasourceCall call = (DatasourceCall)((DatasourceCall)stream.nextElement()).clone(); call.setQuery(writeQuery); sessionToUse.executeCall(call, this.getTranslationRow(), writeQuery); } } }
getInsertQuery().setDescriptor(descriptor); if (getUpdateQuery() != null) { getUpdateQuery().setDescriptor(descriptor);
getInsertQuery().setDescriptor(descriptor); if (getUpdateQuery() != null) { getUpdateQuery().setDescriptor(descriptor);
queryManager.getUpdateQuery().setModifyRow(getObjectBuilder().buildTemplateUpdateRow(session));
queryManager.getUpdateQuery().setModifyRow(getObjectBuilder().buildTemplateUpdateRow(session));
setUpdateQuery((UpdateObjectQuery)parentQueryManager.getUpdateQuery().clone());