public class RetrieveDescImpl extends Object implements RetrieveDesc, Cloneable
| Modifier and Type | Field and Description |
|---|---|
static int |
OPT_ADD_FETCHGROUPS
Indicates, that fetch group fields should be added.
|
static int |
OPT_ADD_KEYS_ONLY
Indicates, that only key fields should be added.
|
static int |
OPT_AGGREGATE
Sum of all aggregate options.
|
static int |
OPT_AGGREGATE_NON_COUNT_PC
Sum of all aggregate options excluding count on persistent capable objects.
|
static int |
OPT_AVG
Indicates, that an avg aggregate query should be run.
|
static int |
OPT_COUNT
Indicates, that a count aggregate query should be run.
|
static int |
OPT_COUNT_PC
Special treatment for count on persistent capable objects.
|
static int |
OPT_DISABLE_RELATIONSHIP_PREFETCH
Indicates, that even if relationship fields are in DFG, they should not
be prefetched.
|
static int |
OPT_DISTINCT
Indicates, that a distinct query should be run.
|
static int |
OPT_FOR_UPDATE
Indicates, that the selected rows should be locked for update.
|
static int |
OPT_MAX
Indicates, that a max aggregate query should be run.
|
static int |
OPT_MIN
Indicates, that a min aggregate query should be run.
|
static int |
OPT_PROJECTION
Indicates, that the query projects on this RD.
|
static int |
OPT_SUM
Indicates, that a sum aggregate query should be run.
|
static int |
OPT_VERIFY
Indicates special treatment for version consistency verifications.
|
LOG_CREATE, LOG_DESTROY, LOG_NOOP, LOG_UPDATE, OP_ABS, OP_ADD, OP_AND, OP_APPROX, OP_AVG, OP_BETWEEN, OP_CONCAT, OP_COUNT, OP_COUNT_PC, OP_DISTINCT, OP_DIV, OP_EQ, OP_EQ_CLASS, OP_EQUIJOIN, OP_EXISTS, OP_FIELD, OP_FOR_UPDATE, OP_GE, OP_GT, OP_IN, OP_LE, OP_LEFTJOIN, OP_LENGTH, OP_LENGTHB, OP_LIKE, OP_LIKE_ESCAPE, OP_LOWER, OP_LT, OP_LTRIM, OP_MAX, OP_MAX_ROWS, OP_MAYBE_NULL, OP_MIN, OP_MOD, OP_MUL, OP_NE, OP_NONKEY, OP_NONREL_JOIN, OP_NOT, OP_NOTEXISTS, OP_NOTIN, OP_NOTNULL, OP_NULL, OP_NULL_COMPARISION_FUNCTION, OP_OR, OP_ORDERBY, OP_ORDERBY_DESC, OP_PARAMETER, OP_PARAMETER_COUNT, OP_POSITION, OP_POSITION_START, OP_RIGHTJOIN, OP_RTRIM, OP_RTRIMFIXED, OP_SOUNDEX, OP_SQRT, OP_SUB, OP_SUBSTR, OP_SUBSTRB, OP_SUBSTRING, OP_SUM, OP_UPPER, OP_VALUE| Constructor and Description |
|---|
RetrieveDescImpl(Class pcClass,
ClassDesc config) |
| Modifier and Type | Method and Description |
|---|---|
void |
addConstraint(String name,
int operation,
Object value)
The addConstraint method is used to limit the values of fields for
objects being selected.
|
void |
addConstraint(String name,
int operation,
RetrieveDesc foreignConstraint,
String foreignName)
Adds a constraint on the relationship field specified by
name. |
void |
addConstraint(String name,
RetrieveDesc foreignConstraint)
Adds a constraint on the foreign field specified by
name. |
void |
addParameterConstraint(LocalFieldDesc field,
int index)
Add ParameterConstraint corresponding to given
field
at given index. |
void |
addParameterConstraints(LocalFieldDesc[] fields,
int startIndex)
Add Constraints corresponding to given
fields. |
void |
addPrefetchedField(String name,
RetrieveDesc foreignConstraint)
Add a field specified by
name to the list of fields to be prefetched. |
void |
addResult(int opCode,
int aggregateResultType)
The addResult method can be used to specify
|
void |
addResult(String name,
RetrieveDesc foreignConstraint,
boolean projection)
The addResult method is used to specify which fields should be
returned in a persistent object.
|
SelectQueryPlan |
buildQueryPlan(SQLStoreManager store,
Concurrency concurrency)
Builds the internal query plan and initializes the select statements.
|
Object |
clone() |
int |
getAggregateResultType()
Returns the result type for aggregate queries.
|
ClassDesc |
getConfig() |
Constraint |
getConstraint() |
Iterator |
getFields() |
Object |
getNavigationalId()
Returns the navigational id of this retrieve descriptor.
|
int |
getOptions()
Returns the options of this retrieve descriptor.
|
Class |
getPersistenceCapableClass() |
SelectQueryPlan |
getPlan() |
void |
setNavigationalId(Object navigationalId)
Sets a navigational id on the retrieve descriptor.
|
void |
setOption(int option)
Sets option
option. |
void |
setPlan(SelectQueryPlan plan) |
void |
setPrefetchEnabled(boolean prefetchEnabled)
Sets the prefetchEnabled option.
|
public static final int OPT_PROJECTION
public static final int OPT_DISTINCT
public static final int OPT_FOR_UPDATE
public static final int OPT_AVG
public static final int OPT_MIN
public static final int OPT_MAX
public static final int OPT_SUM
public static final int OPT_COUNT
public static final int OPT_COUNT_PC
public static final int OPT_AGGREGATE
public static final int OPT_AGGREGATE_NON_COUNT_PC
public static final int OPT_ADD_FETCHGROUPS
public static final int OPT_ADD_KEYS_ONLY
public static final int OPT_DISABLE_RELATIONSHIP_PREFETCH
public static final int OPT_VERIFY
public void addResult(String name, RetrieveDesc foreignConstraint, boolean projection)
projection is true, the field
specified by name should be projected.addResult in interface RetrieveDescname - The name of the field to return.foreignConstraint - RetrieveDesc describing fields and constraints for a referenced object.projection - Specifies, if this is a projection.public void addResult(int opCode,
int aggregateResultType)
addResult in interface RetrieveDescopCode - The operation code.aggregateResultType - The object type returned by aggregate queries.FieldTypeEnumerationpublic void addPrefetchedField(String name, RetrieveDesc foreignConstraint)
name to the list of fields to be prefetched.name - Name of the field to be prefetched.foreignConstraint - This parameter is null if the field is a local field.
If the field is a foreign field, this parameter should be not null and must refer
to an instance of RetrieveDesc correpsonding to the config of the foreign field.public void setPrefetchEnabled(boolean prefetchEnabled)
setPrefetchEnabled in interface RetrieveDescprefetchEnabled - the setting of the prefetchEnabled option.public void addConstraint(String name, RetrieveDesc foreignConstraint)
Adds a constraint on the foreign field specified by
name. This method is used to specify a relationship
navigation on field name to the class represented by
the retrieve descriptor foreignConstraint.
If name is null, an unrelated constraint is added.
A constraint is unrelated, if there is neither a foreign field
nor a local field connecting to the retrieve descriptor
foreignConstraint.
addConstraint in interface RetrieveDescpublic void addConstraint(String name, int operation, RetrieveDesc foreignConstraint, String foreignName)
Adds a constraint on the relationship field specified by
name.
This method is useful e.g. for comparisons of local fields with field of a related object:
emp.addConstraint("lastName", ActionDesc.OP_EQ, mgr, lastName");
compares the employee's lastName field with the lastName field of the related manager.
addConstraint in interface RetrieveDescpublic void addConstraint(String name, int operation, Object value)
addConstraint in interface RetrieveDescname - The name parameter specifies the field whose value
should be limited.operation - The operation parameter specifies the relationship the field
should bear to the value. Values for operation are defined in
the ActionDesc interface.value - The value parameter usually specifies the value to which the
field should be limited, however it is sometimes used to
hold a parameter count as for the OP_IN operation.public void addParameterConstraints(LocalFieldDesc[] fields, int startIndex)
fields.
The constraints are added as Parameter Constraints.
index of the parameter starts at given startIndexfields - fields for which constraints are to be added.startIndex - starting Index for the parameter.public void addParameterConstraint(LocalFieldDesc field, int index)
field
at given index.field - The field for which constraints are to be added.index - Index at which the ParameterConstraint is to be inserted.public SelectQueryPlan buildQueryPlan(SQLStoreManager store, Concurrency concurrency)
SQLStoreManager.retrieve(
com.sun.jdo.spi.persistence.support.sqlstore.PersistenceManager,
RetrieveDesc, com.sun.jdo.spi.persistence.support.sqlstore.ValueFetcher).public void setNavigationalId(Object navigationalId)
setNavigationalId in interface RetrieveDescnavigationalId - Tag to discriminate different retrieve
descriptors that use the same navigational field.public Object getNavigationalId()
public void setOption(int option)
option. Only used to mark this
retrieve descriptor as internal. All valid options are defined
in this class.option - Option being set.public int getAggregateResultType()
public int getOptions()
public SelectQueryPlan getPlan()
public ClassDesc getConfig()
public void setPlan(SelectQueryPlan plan)
public Class getPersistenceCapableClass()
getPersistenceCapableClass in interface ActionDescpublic Constraint getConstraint()
public Iterator getFields()
Copyright © 2019. All rights reserved.