Class JPAAbstractJoinQuery

java.lang.Object
com.sap.olingo.jpa.processor.core.query.JPAAbstractQuery
com.sap.olingo.jpa.processor.core.query.JPAAbstractJoinQuery
All Implemented Interfaces:
JPAQuery
Direct Known Subclasses:
JPACollectionJoinQuery, JPAExpandJoinQuery, JPAExpandSubQuery, JPAJoinQuery

public abstract class JPAAbstractJoinQuery extends JPAAbstractQuery implements JPAQuery
  • Field Details

  • Constructor Details

  • Method Details

    • getQuery

      public javax.persistence.criteria.AbstractQuery<?> getQuery()
      Specified by:
      getQuery in class JPAAbstractQuery
    • getRoot

      public javax.persistence.criteria.From<?,​?> getRoot()
      Specified by:
      getRoot in class JPAAbstractQuery
    • addTopSkip

      protected void addTopSkip(javax.persistence.TypedQuery<javax.persistence.Tuple> tq) throws org.apache.olingo.server.api.ODataApplicationException
      Applies the $skip and $top options of the OData request to the query. The values are defined as follows:
      • The $top system query option specifies a non-negative integer n that limits the number of items returned from a collection.
      • The $skip system query option specifies a non-negative integer n that excludes the first n items of the queried collection from the result.
      These values can be restricted by a page provided by server driven paging

      For details see: OData Version 4.0 Part 1 - 11.2.5.3 System Query Option $top and OData Version 4.0 Part 1 - 11.2.5.7 Server-Driven Paging

      Throws:
      org.apache.olingo.server.api.ODataApplicationException
    • buildEntityPathList

      protected List<com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAPath> buildEntityPathList(com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAEntityType jpaEntity) throws org.apache.olingo.server.api.ODataApplicationException
      Throws:
      org.apache.olingo.server.api.ODataApplicationException
    • buildSelectionAddNavigationAndSelect

      protected final void buildSelectionAddNavigationAndSelect(org.apache.olingo.server.api.uri.UriInfoResource uriResource, Set<com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAPath> jpaPathList, org.apache.olingo.server.api.uri.queryoption.SelectOption select) throws org.apache.olingo.server.api.ODataApplicationException, com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException
      Throws:
      org.apache.olingo.server.api.ODataApplicationException
      com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException
    • buildSelectionPathList

      protected Set<com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAPath> buildSelectionPathList(org.apache.olingo.server.api.uri.UriInfoResource uriResource) throws org.apache.olingo.server.api.ODataApplicationException
      Creates the path to all properties that need to be selected from the database. A Property can be included for the following reasons:
      • It is a key in order to be able to build the links
      • It is part of the $select system query option
      • It is the result of a navigation, which my be restricted by a $select
      • If is required to link $expand with result with the parent result
      • A stream is requested and the property contains the mime type
      Not included are collection properties.
      Parameters:
      uriResource -
      Returns:
      Throws:
      org.apache.olingo.server.api.ODataApplicationException
    • createFromClause

      protected Map<String,​javax.persistence.criteria.From<?,​?>> createFromClause(List<com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAAssociationPath> orderByTarget, Collection<com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAPath> selectionPath, javax.persistence.criteria.CriteriaQuery<?> query, JPANavigationProptertyInfo lastInfo) throws org.apache.olingo.server.api.ODataApplicationException, JPANoSelectionException
      Parameters:
      orderByTarget -
      descriptionFields - List of the requested fields that of type description
      query -
      lastInfo -
      queryRoot -
      Returns:
      Throws:
      org.apache.olingo.server.api.ODataApplicationException
      JPANoSelectionException
    • createKeyWhere

      protected final javax.persistence.criteria.Expression<Boolean> createKeyWhere(List<JPANavigationProptertyInfo> info) throws org.apache.olingo.server.api.ODataApplicationException
      Throws:
      org.apache.olingo.server.api.ODataApplicationException
    • createProtectionWhere

      protected javax.persistence.criteria.Expression<Boolean> createProtectionWhere(Optional<JPAODataClaimProvider> claimsProvider) throws ODataJPAQueryException
      Throws:
      ODataJPAQueryException
    • createSelectClause

      protected List<javax.persistence.criteria.Selection<?>> createSelectClause(Map<String,​javax.persistence.criteria.From<?,​?>> joinTables, Collection<com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAPath> requestedProperties, javax.persistence.criteria.From<?,​?> target, List<String> groups) throws org.apache.olingo.server.api.ODataApplicationException
      The value of the $select query option is a comma-separated list of properties, qualified action names, qualified function names, the star operator (*), or the star operator prefixed with the namespace or alias of the schema in order to specify all operations defined in the schema. See: OData Version 4.0 Part 1 - 11.2.4.1 System Query Option $select

      See also: OData Version 4.0 Part 2 - 5.1.3 System Query Option $select

      Parameters:
      joinTables -
      requestedProperties -
      optional -
      Returns:
      Throws:
      org.apache.olingo.server.api.ODataApplicationException
    • createWhere

      protected javax.persistence.criteria.Expression<Boolean> createWhere(org.apache.olingo.server.api.uri.UriInfoResource uriInfo, List<JPANavigationProptertyInfo> navigationInfo) throws org.apache.olingo.server.api.ODataApplicationException
      Throws:
      org.apache.olingo.server.api.ODataApplicationException
    • determineAssoziation

      protected com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAAssociationPath determineAssoziation(org.apache.olingo.server.api.uri.UriResourcePartTyped naviStart, StringBuilder associationName) throws org.apache.olingo.server.api.ODataApplicationException
      Throws:
      org.apache.olingo.server.api.ODataApplicationException
    • determineLastInfo

      protected JPANavigationProptertyInfo determineLastInfo(List<JPANavigationProptertyInfo> naviInfo)
    • determineTargetIsCollection

      protected final boolean determineTargetIsCollection(org.apache.olingo.server.api.uri.UriInfoResource uriResource)
    • expandPath

      protected void expandPath(com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAEntityType jpaEntity, Collection<com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAPath> jpaPathList, String selectItem, boolean targetIsCollection) throws com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException, ODataJPAQueryException
      Throws:
      com.sap.olingo.jpa.metadata.core.edm.mapper.exception.ODataJPAModelException
      ODataJPAQueryException
    • extractDescriptionAttributes

      protected List<com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAPath> extractDescriptionAttributes(Collection<com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAPath> jpaPathList)
    • generateCollectionAttributeJoin

      protected void generateCollectionAttributeJoin(Map<String,​javax.persistence.criteria.From<?,​?>> joinTables, Collection<com.sap.olingo.jpa.metadata.core.edm.mapper.api.JPAPath> jpaPathList, JPANavigationProptertyInfo lastInfo) throws JPANoSelectionException, ODataJPAProcessorException
      Throws:
      JPANoSelectionException
      ODataJPAProcessorException
    • getLocale

      protected Locale getLocale()
      Specified by:
      getLocale in class JPAAbstractQuery
    • createBoundary

      protected <Y extends Comparable<? super Y>> javax.persistence.criteria.Expression<Boolean> createBoundary(List<JPANavigationProptertyInfo> info, Optional<JPAKeyBoundary> keyBoundary) throws ODataJPAQueryException
      Throws:
      ODataJPAQueryException