Methods Summary |
---|
protected void | afterTranslateCustomQuery(java.util.Vector updatedParameters, java.util.Vector updatedParameterTypes)INTERNAL:
Set the data passed through setCustomSQLArgumentType and useCustomSQLCursorOutputAsResultSet methods.
for (int i = 0; i < getParameters().size(); i++) {
Integer parameterType = (Integer)getParameterTypes().elementAt(i);
Object parameter = getParameters().elementAt(i);
if ((parameterType == MODIFY) || (parameterType == OUT) || (parameterType == OUT_CURSOR) || ((parameterType == IN) && parameter instanceof DatabaseField)) {
DatabaseField field = (DatabaseField)parameter;
afterTranslateCustomQueryUpdateParameter(field, i, parameterType, updatedParameters, updatedParameterTypes);
} else if (parameterType == INOUT) {
DatabaseField outField = (DatabaseField)((Object[])parameter)[1];
afterTranslateCustomQueryUpdateParameter(outField, i, parameterType, updatedParameters, updatedParameterTypes);
if ((((Object[])parameter)[0] instanceof DatabaseField) && (((Object[])parameter)[0] != ((Object[])parameter)[1])) {
DatabaseField inField = (DatabaseField)((Object[])parameter)[0];
afterTranslateCustomQueryUpdateParameter(inField, i, parameterType, updatedParameters, updatedParameterTypes);
}
}
}
|
protected void | afterTranslateCustomQueryUpdateParameter(oracle.toplink.essentials.internal.helper.DatabaseField field, int index, java.lang.Integer parameterType, java.util.Vector updatedParameters, java.util.Vector updatedParameterTypes)INTERNAL:
Set the data passed through setCustomSQLArgumentType and useCustomSQLCursorOutputAsResultSet methods.
for (int j = 0; j < updatedParameters.size(); j++) {
DatabaseField updateField = (DatabaseField)updatedParameters.elementAt(j);
if (field.equals(updateField)) {
Integer updateParameterType = (Integer)updatedParameterTypes.elementAt(j);
if (updateParameterType == null) {
field.setType(updateField.getType());
} else if (updateParameterType == OUT_CURSOR) {
if (parameterType == OUT) {
getParameterTypes().setElementAt(OUT_CURSOR, index);
} else {
throw ValidationException.cannotSetCursorForParameterTypeOtherThanOut(field.getName(), toString());
}
}
break;
}
}
|
public void | appendTranslationParameter(java.io.Writer writer, oracle.toplink.essentials.internal.expressions.ParameterExpression expression, oracle.toplink.essentials.internal.databaseaccess.DatabasePlatform platform)INTERNAL:
All values are printed as ? to allow for parameter binding or translation during the execute of the call.
try {
platform.writeParameterMarker(writer, expression);
} catch (IOException exception) {
throw ValidationException.fileError(exception);
}
getParameters().addElement(expression);
getParameterTypes().addElement(TRANSLATION);
|
public boolean | hasCustomSQLArguments()INTERNAL:
Used to avoid misiterpreting the # in custom SQL.
return hasCustomSQLArguments;
|
public boolean | isQueryStringCall()
return true;
|
public boolean | isSQLCall()
return true;
|
protected void | prepareInternal(oracle.toplink.essentials.internal.sessions.AbstractSession session)INTERNAL:
Called by prepare method only.
if (hasCustomSQLArguments()) {
// hold results of setCustomSQLArgumentType and useCustomSQLCursorOutputAsResultSet methods
Vector updatedParameters = null;
Vector updatedParameterTypes = null;
if (getParameters().size() > 0) {
updatedParameters = getParameters();
setParameters(oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance());
updatedParameterTypes = getParameterTypes();
setParameterTypes(oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance());
}
translateCustomQuery();
if (updatedParameters != null) {
afterTranslateCustomQuery(updatedParameters, updatedParameterTypes);
}
}
super.prepareInternal(session);
|
public void | setCustomSQLArgumentType(java.lang.String customParameterName, java.lang.Class type)PUBLIC:
This method should only be used with custom SQL:
it sets a type to OUT or INOUT parameter (prefixed with ### or #### in custom SQL string).
DatabaseField field = new DatabaseField(customParameterName);
field.setType(type);
getParameters().add(field);
getParameterTypes().add(null);
|
public void | setHasCustomSQLArguments(boolean hasCustomSQLArguments)INTERNAL:
Used to avoid misiterpreting the # in custom SQL.
this.hasCustomSQLArguments = hasCustomSQLArguments;
|
public void | setSQLString(java.lang.String sqlString)Set the SQL string.
setSQLStringInternal(sqlString);
|
public void | useCustomSQLCursorOutputAsResultSet(java.lang.String customParameterName)PUBLIC:
This method should only be used with custom SQL:
Used for Oracle result sets through procedures.
It defines OUT parameter (prefixed with ### in custom SQL string)
as a cursor output.
DatabaseField field = new DatabaseField(customParameterName);
getParameters().add(field);
getParameterTypes().add(OUT_CURSOR);
setIsCursorOutputProcedure(true);
|