Class JPAExpandQueryResult
java.lang.Object
com.sap.olingo.jpa.processor.core.query.JPAExpandQueryResult
- All Implemented Interfaces:
JPAExpandResult,JPAConvertableResult
public final class JPAExpandQueryResult
extends Object
implements JPAExpandResult, JPAConvertableResult
Builds a hierarchy of expand results. One instance contains on the one hand of the result itself, a map which has the
join columns values of the parent as its key and on the other hand a map that point the results of the next expand.
The join columns are concatenated in the order they are stored in the corresponding Association Path.
- Author:
- Oliver Grande
-
Field Summary
Fields inherited from interface com.sap.olingo.jpa.processor.core.converter.JPAExpandResult
ROOT_RESULT_KEY -
Constructor Summary
ConstructorsConstructorDescriptionJPAExpandQueryResult(com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAEntityType jpaEntityType, Collection<com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAPath> selectionPath)JPAExpandQueryResult(Map<String,List<javax.persistence.Tuple>> result, Map<String,Long> counts, com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAEntityType jpaEntityType, Collection<com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAPath> selectionPath) -
Method Summary
Modifier and TypeMethodDescriptionasEntityCollection(JPATupleChildConverter converter)voidconvert(JPATupleChildConverter converter)getChild(com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAAssociationPath associationPath)Map<com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAAssociationPath,JPAExpandResult>org.apache.olingo.commons.api.data.EntityCollectiongetEntityCollection(String key)no key --> empty collectioncom.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAEntityTypegetKeyBoundary(JPAODataRequestContextAccess requestContext, List<JPANavigationProptertyInfo> hops)Returns a key pair if the query had $top and/or $skip and the key of the entity implementsComparable.longlongList<javax.persistence.Tuple>booleanhasCount()voidputChildren(Map<com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAAssociationPath,JPAExpandResult> childResults)
-
Constructor Details
-
JPAExpandQueryResult
public JPAExpandQueryResult(com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAEntityType jpaEntityType, Collection<com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAPath> selectionPath) -
JPAExpandQueryResult
-
-
Method Details
-
asEntityCollection
public Map<String,org.apache.olingo.commons.api.data.EntityCollection> asEntityCollection(JPATupleChildConverter converter) throws org.apache.olingo.server.api.ODataApplicationException- Specified by:
asEntityCollectionin interfaceJPAConvertableResult- Returns:
- Throws:
org.apache.olingo.server.api.ODataApplicationException
-
convert
public void convert(JPATupleChildConverter converter) throws org.apache.olingo.server.api.ODataApplicationException- Specified by:
convertin interfaceJPAExpandResult- Throws:
org.apache.olingo.server.api.ODataApplicationException
-
getChild
public JPAExpandResult getChild(com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAAssociationPath associationPath)- Specified by:
getChildin interfaceJPAExpandResult
-
getChildren
public Map<com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAAssociationPath,JPAExpandResult> getChildren()- Specified by:
getChildrenin interfaceJPAExpandResult
-
getCount
- Specified by:
getCountin interfaceJPAExpandResult
-
getEntityType
public com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAEntityType getEntityType()- Specified by:
getEntityTypein interfaceJPAExpandResult
-
getNoResults
public long getNoResults() -
getNoResultsDeep
public long getNoResultsDeep() -
getResult
- Specified by:
getResultin interfaceJPAExpandResult
-
hasCount
public boolean hasCount()- Specified by:
hasCountin interfaceJPAExpandResult
-
putChildren
public void putChildren(Map<com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAAssociationPath,JPAExpandResult> childResults) throws org.apache.olingo.server.api.ODataApplicationException- Specified by:
putChildrenin interfaceJPAConvertableResult- Throws:
org.apache.olingo.server.api.ODataApplicationException
-
getResults
- Specified by:
getResultsin interfaceJPAExpandResult
-
getEntityCollection
no key --> empty collection- Specified by:
getEntityCollectionin interfaceJPAConvertableResult- Parameters:
key-- Returns:
-
getKeyBoundary
public Optional<JPAKeyBoundary> getKeyBoundary(JPAODataRequestContextAccess requestContext, List<JPANavigationProptertyInfo> hops) throws ODataJPAQueryExceptionDescription copied from interface:JPAConvertableResultReturns a key pair if the query had $top and/or $skip and the key of the entity implementsComparable.- Specified by:
getKeyBoundaryin interfaceJPAConvertableResult- Returns:
- Throws:
ODataJPAQueryException
-