Package com.j_spaces.jdbc.builder
Class QueryTemplatePacket
- All Implemented Interfaces:
RawEntry,ISwapExternalizable,IEntryPacket,ITemplatePacket,ITransportPacket,IMVCCEntryPacket,Textualizable,SmartExternalizable,Externalizable,Serializable,Cloneable
- Direct Known Subclasses:
UnionTemplatePacket
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AggregationSetprotected booleanstatic final IQueryIndexScannerprotected booleanFields inherited from class com.j_spaces.core.ExternalTemplatePacket
_extendedMatchCodeColumns, _extendedMatchCodes, _rangeValues, _rangeValuesInclusionFields inherited from class com.j_spaces.core.ExternalEntryPacket
_implClassNameFields inherited from class com.gigaspaces.internal.transport.EntryPacket
_returnOnlyUIDs, _typeNameFields inherited from class com.gigaspaces.internal.transport.AbstractEntryPacket
_entryType, _entryTypeCode, _typeDesc, _typeDescChecksum -
Constructor Summary
ConstructorsConstructorDescriptionQueryTemplatePacket(QueryTemplatePacket template) QueryTemplatePacket(QueryTableData table, QueryResultTypeInternal queryResultType) QueryTemplatePacket(QueryTableData table, QueryResultTypeInternal queryResultType, IContainsItemsCustomQuery containsItemsQuery) QueryTemplatePacket(QueryTableData table, QueryResultTypeInternal queryResultType, String fieldName, Range range) -
Method Summary
Modifier and TypeMethodDescriptionand(QueryTemplatePacket template) Merge given templates into one template.and(UnionTemplatePacket template) Merge given templates into one template.buildAndPacket(QueryTemplatePacket packet) buildOrPacket(QueryTemplatePacket packet) booleanIndicates if smart externalizable serialization should detect shared references of instances within serializtion contextConverts the external entry to a map of rangesvoidintersectRanges(QueryTemplatePacket template) Merge given templates into one template.protected voidintersectUids(QueryTemplatePacket template) booleanbooleanbooleanMethod to indicate whether this query is complex - false only if the template can be translated to a space query without post processing some space operations don't support complex queriesbooleanprotected booleanmatches(IEntryPacket entryPacket) booleanmatches(JoinedEntry joinedEntry) voidprepareForSpace(ITypeDesc typeDesc) Convert the ranges to a single space templatevoidprepareForUnion(ITypeDesc typeDesc) Temporary method used only for "OR" queries.read(ISpaceProxy space, SQLQuery filter, Transaction txn, long timeout, int modifiers, boolean ifExists, int maxResults, int minEntriesToWaitFor) read(ISpaceProxy space, AbstractDMLQuery query, Transaction txn, int modifiers, int maxResults) protected voidreadExternal(ObjectInput in, PlatformLogicalVersion version) voidreadMultiple(ISpaceProxy space, SQLQuery filter, Transaction txn, int maxResults, int modifiers) readMultiple(ISpaceProxy space, Transaction txn, int maxResults, int modifiers) voidsetAggregationSet(AggregationSet aggregationSet) voidsetAlwaysEmpty(boolean isAlwaysEmpty) voidsetEntryType(EntryType objectType) voidsetExplainPlan(ExplainPlan explainPlan) voidsetExtendedMatchCode(int index, short eq) voidsetExtendedMatchCodeColumns(int index, short eq) voidsetMultipleUids(Set<String> multipleUids) voidsetProjectionTemplate(AbstractProjectionTemplate projectionTemplate) voidsetQueryResultType(QueryResultTypeInternal queryResultType) voidsetRangeValue(int index, Object range) voidsetRangeValueInclusion(int index, boolean include) voidsetRouting(Object routing) Sets the routing value for the template.take(IJSpace space, Object routing, AbstractProjectionTemplate projectionTemplate, Transaction txn, long timeout, int modifiers, boolean ifExists, int maxResults, int minEntriesToWaitFor, QueryResultTypeInternal resultType) union(QueryTemplatePacket packet) union(UnionTemplatePacket composite) protected voidwriteExternal(ObjectOutput out, PlatformLogicalVersion version) voidwriteToSwap(ObjectOutput out) Methods inherited from class com.j_spaces.core.ExternalTemplatePacket
clone, getExtendedMatchCodeColumns, getExtendedMatchCodes, getRangeValues, getRangeValuesInclusion, isIdQuery, isIdsQuery, isTemplateQuery, supportExtendedMatching, validateMethods inherited from class com.j_spaces.core.ExternalEntryPacket
getExternalEntryImplClassName, getPacketType, toObjectMethods inherited from class com.gigaspaces.internal.transport.EntryPacket
applyMVCCEntryMetadata, getCustomQuery, getDynamicProperties, getFieldValue, getFieldValues, getMultipleUIDs, getMVCCEntryMetadata, getTTL, getTypeName, getUID, getVersion, hasFixedPropertiesArray, isFifo, isMVCCEntryMetadataApplied, isNoWriteLease, isReturnOnlyUids, setCustomQuery, setDynamicProperties, setFieldsValues, setFieldValue, setMultipleUIDs, setReturnOnlyUIDs, setTTL, setUID, setVersionMethods inherited from class com.gigaspaces.internal.transport.AbstractEntryPacket
equals, getCodebase, getEntryType, getID, getIdImpl, getOperationID, getPreviousVersion, getPropertyValue, getTypeDescChecksum, getTypeDescriptor, hashCode, hasPreviousVersion, isExternalizableEntryPacket, isSerializeTypeDesc, readExternalImpl, setOperationID, setPreviousVersion, setPropertyValue, setSerializeTypeDesc, setTypeDesc, supportsTypeDescChecksum, toObject, toObject, toObject, toString, toText, validateStorageType, writeExternalImplMethods inherited from class com.gigaspaces.internal.serialization.AbstractExternalizable
readExternal, writeExternalMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.io.Externalizable
readExternal, writeExternalMethods inherited from interface com.gigaspaces.internal.transport.IEntryPacket
allNullFieldValues, getID, getPreviousVersion, getTTL, hasFixedPropertiesArray, hasPreviousVersion, isExternalizableEntryPacket, isHybrid, setCustomQuery, setPreviousVersion, setTTL, setUIDMethods inherited from interface com.gigaspaces.internal.transport.ITemplatePacket
getTemplateRoutingValue, isBroadcast, isReturnOnlyUids, setDynamicProperties, setReturnOnlyUIDsMethods inherited from interface com.gigaspaces.internal.transport.ITransportPacket
getCodebase, getCustomQuery, getDynamicProperties, getEntryType, getExternalEntryImplClassName, getFieldValue, getFieldValues, getMultipleUIDs, getOperationID, getPacketType, getPropertyValue, getTypeDescChecksum, getTypeDescriptor, getTypeName, getUID, getVersion, isFifo, isNoWriteLease, isSerializeTypeDesc, setFieldsValues, setFieldValue, setMultipleUIDs, setOperationID, setPropertyValue, setSerializeTypeDesc, setTypeDesc, setVersion, supportsTypeDescChecksum, toObject, toObject, toObject, toObject
-
Field Details
-
_preparedForSpace
protected boolean _preparedForSpace -
_aggregationSet
-
_allIndexValuesQuery
protected boolean _allIndexValuesQuery -
_dummyNullIndexScanner
-
-
Constructor Details
-
QueryTemplatePacket
public QueryTemplatePacket() -
QueryTemplatePacket
-
QueryTemplatePacket
public QueryTemplatePacket(QueryTableData table, QueryResultTypeInternal queryResultType, String fieldName, Range range) -
QueryTemplatePacket
public QueryTemplatePacket(QueryTableData table, QueryResultTypeInternal queryResultType, IContainsItemsCustomQuery containsItemsQuery) -
QueryTemplatePacket
-
-
Method Details
-
isTransient
public boolean isTransient()- Specified by:
isTransientin interfaceITransportPacket- Overrides:
isTransientin classEntryPacket
-
prepareForSpace
Convert the ranges to a single space template -
prepareForUnion
Temporary method used only for "OR" queries. Should be united with the prepareForSpace -
getRanges
Converts the external entry to a map of ranges -
isAlwaysEmpty
public boolean isAlwaysEmpty() -
setAlwaysEmpty
public void setAlwaysEmpty(boolean isAlwaysEmpty) -
isComplex
public boolean isComplex()Method to indicate whether this query is complex - false only if the template can be translated to a space query without post processing some space operations don't support complex queries -
buildAndPacket
-
and
Merge given templates into one template. -
and
Merge given templates into one template. for example: x=3 and (y=5 or z=8) ==> (x=3 and y=5) or (x=3 and z=8) -
intersectUids
-
intersectRanges
Merge given templates into one template. If merge fails - the templates are attached to the original exp nodes -
getMultipleUids
-
setMultipleUids
-
setExtendedMatchCode
public void setExtendedMatchCode(int index, short eq) -
setExtendedMatchCodeColumns
public void setExtendedMatchCodeColumns(int index, short eq) -
setRangeValue
-
setRangeValueInclusion
public void setRangeValueInclusion(int index, boolean include) -
setEntryType
-
getQueryResultType
- Specified by:
getQueryResultTypein interfaceITemplatePacket- Overrides:
getQueryResultTypein classExternalTemplatePacket
-
setQueryResultType
-
buildOrPacket
-
union
-
union
-
readMultiple
public IQueryResultSet<IEntryPacket> readMultiple(ISpaceProxy space, Transaction txn, int maxResults, int modifiers) throws Exception - Throws:
Exception
-
readMultiple
public IQueryResultSet<IEntryPacket> readMultiple(ISpaceProxy space, SQLQuery filter, Transaction txn, int maxResults, int modifiers) throws Exception - Throws:
Exception
-
getRoutingFieldValue
- Specified by:
getRoutingFieldValuein interfaceITransportPacket- Overrides:
getRoutingFieldValuein classExternalTemplatePacket
-
setRouting
Sets the routing value for the template. -
getProjectionTemplate
- Specified by:
getProjectionTemplatein interfaceITemplatePacket- Overrides:
getProjectionTemplatein classExternalTemplatePacket
-
setProjectionTemplate
- Specified by:
setProjectionTemplatein interfaceITemplatePacket- Overrides:
setProjectionTemplatein classExternalTemplatePacket
-
getAggregationSet
-
setAggregationSet
-
read
public IQueryResultSet<IEntryPacket> read(ISpaceProxy space, AbstractDMLQuery query, Transaction txn, int modifiers, int maxResults) throws Exception - Throws:
Exception
-
read
public IQueryResultSet<IEntryPacket> read(ISpaceProxy space, SQLQuery filter, Transaction txn, long timeout, int modifiers, boolean ifExists, int maxResults, int minEntriesToWaitFor) throws Exception - Throws:
Exception
-
take
public ArrayList<IEntryPacket> take(IJSpace space, Object routing, AbstractProjectionTemplate projectionTemplate, Transaction txn, long timeout, int modifiers, boolean ifExists, int maxResults, int minEntriesToWaitFor, QueryResultTypeInternal resultType) throws RemoteException, TransactionException, UnusableEntryException, InterruptedException -
matches
-
matches
-
isAllIndexValuesSqlQuery
public boolean isAllIndexValuesSqlQuery()- Specified by:
isAllIndexValuesSqlQueryin interfaceITemplatePacket- Overrides:
isAllIndexValuesSqlQueryin classExternalTemplatePacket
-
writeToSwap
- Specified by:
writeToSwapin interfaceISwapExternalizable- Overrides:
writeToSwapin classExternalTemplatePacket- Throws:
IOException
-
readFromSwap
- Specified by:
readFromSwapin interfaceISwapExternalizable- Overrides:
readFromSwapin classExternalTemplatePacket- Throws:
IOExceptionClassNotFoundException
-
enabledSmartExternalizableWithReference
public boolean enabledSmartExternalizableWithReference()Description copied from interface:SmartExternalizableIndicates if smart externalizable serialization should detect shared references of instances within serializtion context -
writeExternal
- Overrides:
writeExternalin classExternalTemplatePacket- Throws:
IOException
-
readExternal
protected void readExternal(ObjectInput in, PlatformLogicalVersion version) throws IOException, ClassNotFoundException - Overrides:
readExternalin classExternalTemplatePacket- Throws:
IOExceptionClassNotFoundException
-
setExplainPlan
-
getExplainPlan
-