use of com.sun.jdo.spi.persistence.support.sqlstore.model.LocalFieldDesc in project Payara by payara.
the class Statement method getColumnElementForValueNode.
/**
* Gets the column information for the field to which <code>node</code>
* is bound.
* @param node The input node.
* @return Returns null if the node isn't bound to a field. Otherwise
* returns ColumnElement for the primary column of the field to which the
* node is bound.
*/
private static ColumnElement getColumnElementForValueNode(ConstraintValue node) {
ColumnElement columnElement = null;
LocalFieldDesc field = node.getLocalField();
if (field != null) {
// For fields mapped to multiple columns, we assume
// that all the columns have the same value in the database.
// Hence we only use the primary column in where clause.
columnElement = field.getPrimaryColumn();
}
return columnElement;
}
use of com.sun.jdo.spi.persistence.support.sqlstore.model.LocalFieldDesc in project Payara by payara.
the class Statement method processConstraintField.
private void processConstraintField(ConstraintField fieldNode, StringBuffer result) {
LocalFieldDesc desc = null;
QueryPlan thePlan = getOriginalPlan(fieldNode);
if (fieldNode instanceof ConstraintFieldDesc) {
desc = ((ConstraintFieldDesc) fieldNode).desc;
} else if (fieldNode instanceof ConstraintFieldName) {
desc = thePlan.config.getLocalFieldDesc(((ConstraintFieldName) fieldNode).name);
} else {
throw new JDOFatalInternalException(I18NHelper.getMessage(messages, // NOI18N
"core.generic.notinstanceof", fieldNode.getClass().getName(), // NOI18N
"ConstraintFieldDesc/ConstraintFieldName"));
}
generateColumnText(desc, thePlan, result);
}
use of com.sun.jdo.spi.persistence.support.sqlstore.model.LocalFieldDesc in project Payara by payara.
the class UpdateStatement method addLocalConstraints.
public void addLocalConstraints(int action, ForeignFieldDesc f, SQLStateManager sm) {
for (int i = 0; i < f.localFields.size(); i++) {
LocalFieldDesc lf = (LocalFieldDesc) f.localFields.get(i);
if (action == QueryPlan.ACT_INSERT) {
// For inserts into the join table, we get the values we are inserting
// for the parent object and the added object.
ColumnElement lc = (ColumnElement) f.assocLocalColumns.get(i);
addColumn(lc, lf.getValue(sm));
} else if (action == QueryPlan.ACT_DELETE) {
LocalFieldDesc alf = (LocalFieldDesc) f.assocLocalFields.get(i);
// For deletes from the join table, we get the constraint values
// from the parent object and the remove object.
addConstraint(alf, lf.getValue(sm));
}
}
}
use of com.sun.jdo.spi.persistence.support.sqlstore.model.LocalFieldDesc in project Payara by payara.
the class VerificationSelectPlan method processFields.
/**
* There are no real fields to be selected for verification query.
* This method just adds the tables for the version field.
*/
protected void processFields() {
LocalFieldDesc[] versionFields = config.getVersionFields();
for (int i = 0; i < versionFields.length; i++) {
LocalFieldDesc versionField = versionFields[i];
addTable(versionField);
}
}
Aggregations