/** * ADVANCED: * Return the receiver's insert call. * This allows the user to override the insert operation. */ public Call getInsertCall() { if (getInsertQuery() == null) { return null; } return getInsertQuery().getDatasourceCall(); }
/** * ADVANCED: * Return the receiver's insert call. * This allows the user to override the insert operation. */ public Call getInsertCall() { if (getInsertQuery() == null) { return null; } return getInsertQuery().getDatasourceCall(); }
/** * ADVANCED: * Return the receiver's insert call. * This allows the user to override the insert operation. */ public Call getInsertCall() { if (getInsertQuery() == null) { return null; } return getInsertQuery().getDatasourceCall(); }
/** * ADVANCED: * Return the receiver's insert 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, "insert into EMPLOYEE (F_NAME, L_NAME) values (#F_NAME, #L_NAME)". */ public String getInsertSQLString() { if (getInsertQuery() == null) { return null; } return getInsertQuery().getSQLString(); }
/** * ADVANCED: * Return the receiver's insert 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, "insert into EMPLOYEE (F_NAME, L_NAME) values (#F_NAME, #L_NAME)". */ public String getInsertSQLString() { if (getInsertQuery() == null) { return null; } return getInsertQuery().getSQLString(); }
/** * ADVANCED: * Return the receiver's insert 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, "insert into EMPLOYEE (F_NAME, L_NAME) values (#F_NAME, #L_NAME)". */ public String getInsertSQLString() { if (getInsertQuery() == null) { return null; } return getInsertQuery().getSQLString(); }
/** * Insert the object using the user defined query. * This ensures that the query is cloned and prepared correctly. */ protected void performUserDefinedInsert() { performUserDefinedWrite(getDescriptor().getQueryManager().getInsertQuery()); }
/** * Insert the object using the user defined query. * This ensures that the query is cloned and prepared correctly. */ protected void performUserDefinedInsert() { performUserDefinedWrite(getDescriptor().getQueryManager().getInsertQuery()); }
/** * Insert the object using the user defined query. * This ensures that the query is cloned and prepared correctly. */ protected void performUserDefinedInsert() { performUserDefinedWrite(getDescriptor().getQueryManager().getInsertQuery()); }
/** * 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.hasInsertQuery()) {// and there is a user-defined query (in the query manager) return queryManager.getInsertQuery(); } 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.hasInsertQuery()) {// and there is a user-defined query (in the query manager) return queryManager.getInsertQuery(); } 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.hasInsertQuery()) {// and there is a user-defined query (in the query manager) return queryManager.getInsertQuery(); } return null; }
if (getInsertQuery() != null) { getInsertQuery().setDescriptor(descriptor);
if (getInsertQuery() != null) { getInsertQuery().setDescriptor(descriptor);
/** * INTERNAL: * Returns a clone of InsertObjectQuery from the ClassDescriptor's DescriptorQueryManager or a new one */ private InsertObjectQuery getInsertObjectQuery(AbstractSession session, ClassDescriptor desc) { InsertObjectQuery insertQuery = desc.getQueryManager().getInsertQuery(); if (insertQuery == null) { insertQuery = new InsertObjectQuery(); insertQuery.setDescriptor(desc); insertQuery.checkPrepare(session, insertQuery.getTranslationRow()); } else { // Ensure the query has been prepared. insertQuery.checkPrepare(session, insertQuery.getTranslationRow()); insertQuery = (InsertObjectQuery)insertQuery.clone(); } insertQuery.setIsExecutionClone(true); return insertQuery; } }
/** * INTERNAL: * Returns clone of InsertObjectQuery from the reference descriptor, if it is not set - create it. */ protected InsertObjectQuery getInsertObjectQuery(AbstractSession session, ClassDescriptor desc) { InsertObjectQuery insertQuery = desc.getQueryManager().getInsertQuery(); if (insertQuery == null) { insertQuery = new InsertObjectQuery(); desc.getQueryManager().setInsertQuery(insertQuery); } if (insertQuery.getModifyRow() == null) { AbstractRecord modifyRow = new DatabaseRecord(); for (int i = 0; i < getTargetForeignKeyFields().size(); i++) { DatabaseField field = getTargetForeignKeyFields().elementAt(i); modifyRow.put(field, null); } desc.getObjectBuilder().buildTemplateInsertRow(session, modifyRow); getContainerPolicy().addFieldsForMapKey(modifyRow); if(this.listOrderField != null) { modifyRow.put(this.listOrderField, null); } insertQuery.setModifyRow(modifyRow); } return insertQuery; }
/** * INTERNAL: * Returns a clone of InsertObjectQuery from the ClassDescriptor's DescriptorQueryManager or a new one */ protected InsertObjectQuery getInsertObjectQuery(AbstractSession session, ClassDescriptor desc) { InsertObjectQuery insertQuery = desc.getQueryManager().getInsertQuery(); if (insertQuery == null) { insertQuery = new InsertObjectQuery(); insertQuery.setDescriptor(desc); insertQuery.checkPrepare(session, insertQuery.getTranslationRow()); } else { // Ensure the query has been prepared. insertQuery.checkPrepare(session, insertQuery.getTranslationRow()); insertQuery = (InsertObjectQuery)insertQuery.clone(); } insertQuery.setIsExecutionClone(true); return insertQuery; }
/** * INTERNAL: * Returns clone of InsertObjectQuery from the reference descriptor, if it is not set - create it. */ protected InsertObjectQuery getInsertObjectQuery(AbstractSession session, ClassDescriptor desc) { InsertObjectQuery insertQuery = desc.getQueryManager().getInsertQuery(); if (insertQuery == null) { insertQuery = new InsertObjectQuery(); desc.getQueryManager().setInsertQuery(insertQuery); } if (insertQuery.getModifyRow() == null) { AbstractRecord modifyRow = new DatabaseRecord(); for (int i = 0; i < getTargetForeignKeyFields().size(); i++) { DatabaseField field = getTargetForeignKeyFields().elementAt(i); modifyRow.put(field, null); } desc.getObjectBuilder().buildTemplateInsertRow(session, modifyRow); getContainerPolicy().addFieldsForMapKey(modifyRow); if(this.listOrderField != null) { modifyRow.put(this.listOrderField, null); } insertQuery.setModifyRow(modifyRow); } return insertQuery; }
queryManager.getInsertQuery().setModifyRow(getObjectBuilder().buildTemplateInsertRow(session));
setInsertQuery((InsertObjectQuery)parentQueryManager.getInsertQuery().clone());