Class DataQuerySpecifications<E extends org.n52.series.db.beans.DatasetEntity>

java.lang.Object
org.n52.sensorweb.server.db.query.QuerySpecifications
org.n52.sensorweb.server.db.query.DataQuerySpecifications<E>

public final class DataQuerySpecifications<E extends org.n52.series.db.beans.DatasetEntity> extends QuerySpecifications
  • Method Details

    • of

      public static <E> DataQuerySpecifications of(DbQuery query)
    • matchFilters

      public org.springframework.data.jpa.domain.Specification<org.n52.series.db.beans.DataEntity> matchFilters()
      Aggregates following filters in an AND expression:
      Returns:
      a boolean expression matching all filter criteria
    • matchFiltersParentsIsNull

      public org.springframework.data.jpa.domain.Specification<org.n52.series.db.beans.DataEntity> matchFiltersParentsIsNull()
      Aggregates following filters in an AND expression:
      Returns:
      a boolean expression matching all filter criteria
    • matchFiltersParentsNotNull

      public org.springframework.data.jpa.domain.Specification<org.n52.series.db.beans.DataEntity> matchFiltersParentsNotNull()
      Aggregates following filters in an AND expression:
      Returns:
      a boolean expression matching all filter criteria
    • matchIsNotDeleted

      public org.springframework.data.jpa.domain.Specification<org.n52.series.db.beans.DataEntity> matchIsNotDeleted()
    • matchParentsIsNull

      public org.springframework.data.jpa.domain.Specification<org.n52.series.db.beans.DataEntity> matchParentsIsNull()
      Matches entities so that parent is null.
      Returns:
      a boolean expression
    • matchParentsIsNotNull

      public org.springframework.data.jpa.domain.Specification<org.n52.series.db.beans.DataEntity> matchParentsIsNotNull()
      Matches entities so that parent is not null.
      Returns:
      a boolean expression
    • matchDatasets

      public org.springframework.data.jpa.domain.Specification<org.n52.series.db.beans.DataEntity> matchDatasets()
      Matches data of datasets with given ids.
      Returns:
      a boolean expression
      See Also:
    • matchDatasets

      public org.springframework.data.jpa.domain.Specification<org.n52.series.db.beans.DataEntity> matchDatasets(String... ids)
      Matches data of datasets with given ids.
      Parameters:
      ids - the ids to match
      Returns:
      a boolean expression
      See Also:
    • matchDatasets

      public org.springframework.data.jpa.domain.Specification<org.n52.series.db.beans.DataEntity> matchDatasets(Collection<String> ids)
      Matches data of datasets with given ids. For example:
        where dataset.id in (<ids>)
       
      In case of DbQuery.isMatchDomainIds() returns true the following query path will be used:
        where dataset.identifier in (<ids>)
       
      Parameters:
      ids - the ids to match
      Returns:
      a boolean expression or null when given ids are null or empty
    • matchStart

      public Optional<org.n52.series.db.beans.DataEntity> matchStart(org.n52.series.db.beans.DatasetEntity dataset, javax.persistence.EntityManager entityManager)
    • matchEnd

      public Optional<org.n52.series.db.beans.DataEntity> matchEnd(org.n52.series.db.beans.DatasetEntity dataset, javax.persistence.EntityManager entityManager)
    • matchClosestBeforeStart

      public Optional<org.n52.series.db.beans.DataEntity> matchClosestBeforeStart(org.n52.series.db.beans.DatasetEntity dataset, javax.persistence.EntityManager entityManager)
    • matchClosestAfterEnd

      public Optional<org.n52.series.db.beans.DataEntity> matchClosestAfterEnd(org.n52.series.db.beans.DatasetEntity dataset, javax.persistence.EntityManager entityManager)
    • count

      public Long count(org.n52.series.db.beans.DatasetEntity dataset, javax.persistence.EntityManager entityManager)
    • min

      public org.n52.series.db.beans.DataEntity min(org.n52.series.db.beans.DatasetEntity dataset, javax.persistence.EntityManager entityManager)
    • max

      public org.n52.series.db.beans.DataEntity max(org.n52.series.db.beans.DatasetEntity dataset, javax.persistence.EntityManager entityManager)
    • average

      public BigDecimal average(org.n52.series.db.beans.DatasetEntity dataset, javax.persistence.EntityManager entityManager)
    • matchesSpatially

      public org.springframework.data.jpa.domain.Specification<org.n52.series.db.beans.DataEntity> matchesSpatially()
      Matches datasets which have a feature laying within the given bbox using an intersects query. For example:
         where ST_INTERSECTS(feature.geom, <filter_geometry>)=1
       
      Returns:
      a boolean expression or null when given spatial filter is null or empty