Class AQueryBuilderImpl

java.lang.Object
org.opencastproject.assetmanager.impl.query.AQueryBuilderImpl
All Implemented Interfaces:
AQueryBuilder, EntityPaths

public final class AQueryBuilderImpl extends Object implements AQueryBuilder, EntityPaths
  • Constructor Details

  • Method Details

    • select

      public ASelectQuery select(Target... target)
      Description copied from interface: AQueryBuilder
      Determine what should be included in the result records, i.e. what will actually be fetched from the database. If no target is given, only the media package ID (ARecord.getMediaPackageId()) is fetched.

      Use targets to reduce the amount of database IO, e.g. if you're not interested in the attached properties do not select them. Or, on the other hand if you want to work with properties only, do not select the snapshot (AQueryBuilder.snapshot()).

      Please note that a result record always represents a snapshot accompanied by the properties of the whole episode. That means that always snapshots are being selected. In case a property target is given, it only means that those properties are added to the result set. Please also note that properties are stored per episode, not per snapshot.

      Specified by:
      select in interface AQueryBuilder
      See Also:
    • delete

      public ADeleteQuery delete(String owner, Target target)
      Description copied from interface: AQueryBuilder
      Create a new deletion query.

      The query will only affect snapshots owned by the given owner. If the target is a property the owner parameter will be ignored since properties belong to the whole episode and not to individual snapshots.

      Specified by:
      delete in interface AQueryBuilder
      Parameters:
      owner - the name of the owner or the empty string
    • mediaPackageIds

      public Predicate mediaPackageIds(String... mpIds)
      Specified by:
      mediaPackageIds in interface AQueryBuilder
    • mediaPackageId

      public Predicate mediaPackageId(String mpId)
      Description copied from interface: AQueryBuilder
      Create a predicate to match an snapshot's media package ID.
      Specified by:
      mediaPackageId in interface AQueryBuilder
    • mediapackageId

      public Field<String> mediapackageId()
      Description copied from interface: AQueryBuilder
      Get the snapshot's "mediaPackageId" field. Use it to create a predicate.
      Specified by:
      mediapackageId in interface AQueryBuilder
    • seriesId

      public Field<String> seriesId()
      Description copied from interface: AQueryBuilder
      Get the snapshot's "seriesId" field. Use it to create a predicate.
      Specified by:
      seriesId in interface AQueryBuilder
    • organizationId

      public Predicate organizationId(String orgId)
      Description copied from interface: AQueryBuilder
      Create a predicate to match a snapshot's organization ID.
      Specified by:
      organizationId in interface AQueryBuilder
    • organizationId

      public Field<String> organizationId()
      Description copied from interface: AQueryBuilder
      Get the snapshot's "organizationId" field. Use it to create a predicate.
      Specified by:
      organizationId in interface AQueryBuilder
    • owner

      public Field<String> owner()
      Description copied from interface: AQueryBuilder
      Get the snapshot's "owner" field. Use it to create a predicate.
      Specified by:
      owner in interface AQueryBuilder
    • availability

      public Predicate availability(Availability availability)
      Specified by:
      availability in interface AQueryBuilder
    • storage

      public Predicate storage(String storage)
      Specified by:
      storage in interface AQueryBuilder
    • hasPropertiesOf

      public Predicate hasPropertiesOf(String namespace)
      Description copied from interface: AQueryBuilder
      Create a predicate that matches all snapshots with properties of the given namespace.
      Specified by:
      hasPropertiesOf in interface AQueryBuilder
    • hasProperties

      public Predicate hasProperties()
      Description copied from interface: AQueryBuilder
      Create a predicate that matches all snapshots with properties.
      Specified by:
      hasProperties in interface AQueryBuilder
    • archived

      public Field<Date> archived()
      Description copied from interface: AQueryBuilder
      Get the snapshot's "archived" field. Use it to create a predicate.
      Specified by:
      archived in interface AQueryBuilder
    • version

      public VersionField version()
      Description copied from interface: AQueryBuilder
      Get the snapshot's "version" field. Use it to create a predicate.
      Specified by:
      version in interface AQueryBuilder
    • property

      public <A> PropertyField<A> property(Value.ValueType<A> ev, String namespace, String name)
      Description copied from interface: AQueryBuilder
      Create a field to query properties. Each parameter may be wild carded with the empty string.
      Specified by:
      property in interface AQueryBuilder
      Parameters:
      namespace - the namespace or "" to select all namespaces
      name - the property name or "" to select all property names
    • property

      public <A> PropertyField<A> property(Value.ValueType<A> ev, PropertyName fqn)
      Specified by:
      property in interface AQueryBuilder
    • snapshot

      public Target snapshot()
      Description copied from interface: AQueryBuilder
      Select or delete a snapshot.
      Specified by:
      snapshot in interface AQueryBuilder
    • propertiesOf

      public Target propertiesOf(String... namespace)
      Description copied from interface: AQueryBuilder
      Select or delete all properties that belong to the given namespaces. Use an empty list of arguments to handle all properties of the media package.
      Specified by:
      propertiesOf in interface AQueryBuilder
    • properties

      public Target properties(PropertyName... fqn)
      Description copied from interface: AQueryBuilder
      Select or delete all given properties. Use an empty list of arguments to handle all properties of the media package.
      Specified by:
      properties in interface AQueryBuilder
    • nothing

      public Target nothing()
      Description copied from interface: AQueryBuilder
      The zero element of Target. Selecting nothing just selects nothing.
      Specified by:
      nothing in interface AQueryBuilder
    • always

      public Predicate always()
      Description copied from interface: AQueryBuilder
      The zero element of Predicate. An empty predicate does nothing.
      Specified by:
      always in interface AQueryBuilder