/** * 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 TopLink, 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 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 updateForeignKeyFieldShallow(WriteObjectQuery writeQuery) { // For CR 2923 must move to session we will execute call on now // so correct DatasourcePlatform used by translate. AbstractSession sessionToUse = getSession().getExecutionSession(getQuery()); // 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); } } }
manager.setReadObjectQuery((ReadObjectQuery)getReadObjectQuery().clone()); if (getUpdateQuery() != null) { manager.setUpdateQuery((UpdateObjectQuery)getUpdateQuery().clone());
getInsertQuery().setDescriptor(descriptor); if (getUpdateQuery() != null) { getUpdateQuery().setDescriptor(descriptor);
getUpdateQuery().setModifyRow(getDescriptor().getObjectBuilder().buildTemplateUpdateRow(session));
setUpdateQuery((UpdateObjectQuery)parentQueryManager.getUpdateQuery().clone());