use of com.sun.jdo.api.persistence.support.JDOFatalInternalException in project Payara by payara.
the class ErrorMsg method fatal.
/**
* Indicates a fatal situation (implementation error).
* @param msg error message
*/
public void fatal(String msg, Exception nested) throws JDOFatalInternalException {
JDOFatalInternalException ex = new JDOFatalInternalException(msg, nested);
logger.throwing("jqlc.ErrorMsg", "fatal", ex);
throw ex;
}
use of com.sun.jdo.api.persistence.support.JDOFatalInternalException in project Payara by payara.
the class VariableTable method markUsed.
/**
* Mark the specified variable as used.
* The method sets the info field of the VarInfo object to true.
*/
public void markUsed(JQLAST variable, String dependendVar) {
String name = variable.getText();
VarInfo entry = (VarInfo) varInfos.get(name);
if (entry == null)
throw new JDOFatalInternalException(I18NHelper.getMessage(messages, // NOI18N
"jqlc.variabletable.markused.varnotfound", name));
entry.used.add(variable);
if (dependendVar != null) {
VarInfo dependendVarInfo = (VarInfo) varInfos.get(dependendVar);
if (dependendVarInfo.dependsOn != null)
throw new JDOFatalInternalException(I18NHelper.getMessage(messages, // NOI18N
"jqlc.variabletable.markused.multidep", dependendVar, dependendVarInfo.dependsOn, name));
dependendVarInfo.dependsOn = name;
}
}
use of com.sun.jdo.api.persistence.support.JDOFatalInternalException 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.api.persistence.support.JDOFatalInternalException in project Payara by payara.
the class RetrieveDescImpl method addResult.
/**
* The addResult method is used to specify which fields should be
* returned in a persistent object. If the field requested is a
* reference to another persistent object then a RetrieveDesc may be
* provided which describes which fields of the referenced object
* should be returned and, optionally, constraints on it.
* If the parameter <code>projection</code> is true, the field
* specified by <code>name</code> should be projected.
*
* @param name The name of the field to return.
* @param foreignConstraint
* RetrieveDesc describing fields and constraints for a referenced object.
* @param projection Specifies, if this is a projection.
*/
public void addResult(String name, RetrieveDesc foreignConstraint, boolean projection) {
ConstraintFieldName cfName = new ConstraintFieldName(name, foreignConstraint);
if (projection) {
if ((options & OPT_PROJECTION) > 0) {
throw new JDOFatalInternalException(I18NHelper.getMessage(messages, // NOI18N
"sqlstore.retrievedesc.toomanyprojections"));
}
// For local fields, set the property on the field constraint.
if (foreignConstraint != null) {
((RetrieveDescImpl) foreignConstraint).options |= OPT_PROJECTION;
} else {
cfName.setProjection();
// Set this property if you want to have DFG fields added for
// projections on local fields.
// options = options | OPT_PROJECTION;
}
}
fields.add(cfName);
}
use of com.sun.jdo.api.persistence.support.JDOFatalInternalException in project Payara by payara.
the class QueryPlan method addQueryTable.
/**
* Identifies a database table which will become part of this
* query plan. We will build a QueryTable object describing its
* use and return it.
*
* Note: No join is constructed at this point for the table added.
*
* @param tableElement Identifies which table is being added.
* @param persistenceConfig
* If we are adding a foreign table the persistenceConfig parameter
* holds the PersistenceConfig for the foreign Persistence Class.
*/
public QueryTable addQueryTable(TableElement tableElement, ClassDesc persistenceConfig) {
ClassDesc _config = (persistenceConfig == null) ? this.config : persistenceConfig;
TableDesc tableDesc = _config.findTableDesc(tableElement);
if (tableDesc == null) {
if (tableElement != null) {
throw new JDOFatalInternalException(I18NHelper.getMessage(messages, // NOI18N
"core.configuration.classnotmappedtotable", _config.getPersistenceCapableClass().getName(), tableElement.getName().getName()));
} else {
throw new JDOFatalInternalException(I18NHelper.getMessage(messages, // NOI18N
"core.configuration.classnotmapped", _config.getPersistenceCapableClass().getName()));
}
}
return addQueryTable(tableDesc);
}
Aggregations