/** * INTERNAL: * Return a call built from a statement. Subclasses may throw an exception * if the statement is not appropriate. */ public DatabaseCall buildCallFromStatement(SQLStatement statement, AbstractSession session) { DatabaseCall call = statement.buildCall(session); if (isNativeConnectionRequired()) { call.setIsNativeConnectionRequired(true); } return call; }
/** * INTERNAL: * Return a call built from a statement. Subclasses may throw an exception * if the statement is not appropriate. */ public DatasourceCall buildCallFromStatement(SQLStatement statement, DatabaseQuery query, AbstractSession session) { DatabaseCall call = statement.buildCall(session); if (isNativeConnectionRequired()) { call.setIsNativeConnectionRequired(true); } return call; }
/** * INTERNAL: * Return a call built from a statement. Subclasses may throw an exception * if the statement is not appropriate. */ public DatasourceCall buildCallFromStatement(SQLStatement statement, DatabaseQuery query, AbstractSession session) { DatabaseCall call = statement.buildCall(session); if (isNativeConnectionRequired()) { call.setIsNativeConnectionRequired(true); } return call; }
/** * Build the sql call from the select statement for selecting the locator */ private DatabaseCall buildCallFromSelectStatementForLocator(SQLSelectStatement selectStatement, WriteObjectQuery writeQuery, DatabaseCall dbCall, AbstractSession session) { DatabaseCall call = selectStatement.buildCall(session); // Locator LOB must not be wrapped (WLS wraps LOBs). call.setIsNativeConnectionRequired(this.isNativeConnectionRequired); //the LOB context must be passed into the new call object call.setContexts(dbCall.getContexts()); //need to explicitly define one row return, otherwise, EL assumes multiple rows return and confuses the accessor call.returnOneRow(); //the query object has to be set in order to access to the platform and login objects call.setQuery(writeQuery); // prepare it call.prepare(session); //finally do the translation call.translate(writeQuery.getTranslationRow(), writeQuery.getModifyRow(), session); return call; }
/** * INTERNAL: * Get the ref for the object. * This is required for use by Refs, there might be a better way to do it when objID are supported. * (i.e. getting it from the object or identity map). */ public Ref getRef(Object object, AbstractSession session) { SQLSelectStatement statement = new SQLSelectStatement(); statement.addTable(getTables().firstElement());// Assumed only one for obj-rel descriptors. statement.getFields().addElement(new org.eclipse.persistence.expressions.ExpressionBuilder().ref()); statement.setWhereClause(getObjectBuilder().buildPrimaryKeyExpressionFromObject(object, session)); statement.setRequiresAliases(true); statement.normalize(session, this); ValueReadQuery valueQuery = new ValueReadQuery(); valueQuery.setSQLStatement(statement); valueQuery.checkPrepare(session, new DatabaseRecord(), true); // Must return unwrapped Ref on WLS. valueQuery.getCall().setIsNativeConnectionRequired(true); Ref ref = (Ref)session.executeQuery(valueQuery); return ref; }
/** * Build the sql call from the select statement for selecting the locator */ private DatabaseCall buildCallFromSelectStatementForLocator(SQLSelectStatement selectStatement, WriteObjectQuery writeQuery, DatabaseCall dbCall, AbstractSession session) { DatabaseCall call = selectStatement.buildCall(session); // Locator LOB must not be wrapped (WLS wraps LOBs). call.setIsNativeConnectionRequired(this.isNativeConnectionRequired); //the LOB context must be passed into the new call object call.setContexts(dbCall.getContexts()); //need to explicitly define one row return, otherwise, EL assumes multiple rows return and confuses the accessor call.returnOneRow(); //the query object has to be set in order to access to the platform and login objects call.setQuery(writeQuery); // prepare it call.prepare(session); //finally do the translation call.translate(writeQuery.getTranslationRow(), writeQuery.getModifyRow(), session); return call; }
/** * INTERNAL: * Get the ref for the object. * This is required for use by Refs, there might be a better way to do it when objID are supported. * (i.e. getting it from the object or identity map). */ public Ref getRef(Object object, AbstractSession session) { SQLSelectStatement statement = new SQLSelectStatement(); statement.addTable(getTables().firstElement());// Assumed only one for obj-rel descriptors. statement.getFields().addElement(new org.eclipse.persistence.expressions.ExpressionBuilder().ref()); statement.setWhereClause(getObjectBuilder().buildPrimaryKeyExpressionFromObject(object, session)); statement.setRequiresAliases(true); statement.normalize(session, this); ValueReadQuery valueQuery = new ValueReadQuery(); valueQuery.setSQLStatement(statement); valueQuery.checkPrepare(session, new DatabaseRecord(), true); // Must return unwrapped Ref on WLS. valueQuery.getCall().setIsNativeConnectionRequired(true); Ref ref = (Ref)session.executeQuery(valueQuery); return ref; }
/** * Build the sql call from the select statement for selecting the locator */ private DatabaseCall buildCallFromSelectStatementForLocator(SQLSelectStatement selectStatement, WriteObjectQuery writeQuery, DatabaseCall dbCall, AbstractSession session) { DatabaseCall call = selectStatement.buildCall(session); // Locator LOB must not be wrapped (WLS wraps LOBs). call.setIsNativeConnectionRequired(this.isNativeConnectionRequired); //the LOB context must be passed into the new call object call.setContexts(dbCall.getContexts()); //need to explicitly define one row return, otherwise, EL assumes multiple rows return and confuses the accessor call.returnOneRow(); //the query object has to be set in order to access to the platform and login objects call.setQuery(writeQuery); // prepare it call.prepare(session); //finally do the translation call.translate(writeQuery.getTranslationRow(), writeQuery.getModifyRow(), session); return call; }
/** * INTERNAL: * Get the ref for the object. * This is required for use by Refs, there might be a better way to do it when objID are supported. * (i.e. getting it from the object or identity map). */ public Ref getRef(Object object, AbstractSession session) { SQLSelectStatement statement = new SQLSelectStatement(); statement.addTable(getTables().firstElement());// Assumed only one for obj-rel descriptors. statement.getFields().addElement(new org.eclipse.persistence.expressions.ExpressionBuilder().ref()); statement.setWhereClause(getObjectBuilder().buildPrimaryKeyExpressionFromObject(object, session)); statement.setRequiresAliases(true); statement.normalize(session, this); ValueReadQuery valueQuery = new ValueReadQuery(); valueQuery.setSQLStatement(statement); valueQuery.prepareCall(session, new DatabaseRecord()); // Must return unwrapped Ref on WLS. valueQuery.getCall().setIsNativeConnectionRequired(true); Ref ref = (Ref)session.executeQuery(valueQuery); return ref; }
call.setIsNativeConnectionRequired(true); call.setIsNativeConnectionRequired(true);
call.setQueryTimeoutUnit(this.query.getQueryTimeoutUnit()); if (this.query.isNativeConnectionRequired()) { call.setIsNativeConnectionRequired(true);