use of com.sun.jdo.spi.persistence.utility.ParameterInfo in project Payara by payara.
the class ParameterTable method getParameterInfoForParamName.
/**
* Returns the parameter info for the specified parameter name
* and associated field.
* If the associated field is not known, then null is used as
* input parameter.
* @param paramName
* @param associatedField
* @return corresponding parameterInfo
*/
public ParameterInfo getParameterInfoForParamName(String paramName, String associatedField) {
int index = names.indexOf(paramName);
Type type = (Type) types.get(index);
return new ParameterInfo(index, type.getEnumType(), associatedField);
}
use of com.sun.jdo.spi.persistence.utility.ParameterInfo in project Payara by payara.
the class RetrieveDescImpl method addParameterConstraint.
/**
* Adds information about parameter on the constraint stack.
* @param value Instance of
* <code>com.sun.jdo.spi.persistence.utility.ParameterInfo</code>.
* Contains index, type and name of the field to which
* this parameter is bound. The field name is used when binding
* the parameter to the sql statement.
* name can be null for complex expressions in a filter as described in
* addValueConstraint.
* @see #addValueConstraint
*/
private void addParameterConstraint(Object value) {
if (value instanceof ParameterInfo) {
ParameterInfo parameterInfo = (ParameterInfo) value;
constraint.addParamIndex(parameterInfo.getIndex(), parameterInfo.getType(), getLocalFieldDesc(parameterInfo.getAssociatedField()));
} else {
throw new JDOFatalInternalException(I18NHelper.getMessage(messages, // NOI18N
"core.constraint.illegalParameterInfo"));
}
}
use of com.sun.jdo.spi.persistence.utility.ParameterInfo in project Payara by payara.
the class RetrieveDescImpl method addParameterConstraint.
/**
* Add ParameterConstraint corresponding to given <code>field</code>
* at given <code>index</code>.
* @param field The field for which constraints are to be added.
* @param index Index at which the ParameterConstraint is to be inserted.
*/
public void addParameterConstraint(LocalFieldDesc field, int index) {
// Generate parameter info for this parameter.
String fieldName = field.getName();
int type = field.getEnumType();
addConstraint(null, ActionDesc.OP_PARAMETER, new ParameterInfo(index, type, fieldName));
addConstraint(fieldName, ActionDesc.OP_FIELD, null);
addConstraint(null, ActionDesc.OP_EQ, null);
}
Aggregations