Interface AQueryBuilder
-
public interface AQueryBuilderTo phrase queries to theAssetManager.Implementations are supposed to be immutable so that one builder can be safely used in a concurrent environment.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description Predicatealways()The zero element ofPredicate.Field<Date>archived()Get the snapshot's "archived" field.Predicateavailability(Availability availability)ADeleteQuerydelete(String owner, Target target)Create a new deletion query.PredicatehasProperties()Create a predicate that matches all snapshots with properties.PredicatehasPropertiesOf(String namespace)Create a predicate that matches all snapshots with properties of the given namespace.Field<String>mediapackageId()Get the snapshot's "mediaPackageId" field.PredicatemediaPackageId(String mpId)Create a predicate to match an snapshot's media package ID.PredicatemediaPackageIds(String... mpIds)Targetnothing()The zero element ofTarget.Field<String>organizationId()Get the snapshot's "organizationId" field.PredicateorganizationId(String orgId)Deprecated.useorganizationId().eq(orgId) insteadField<String>owner()Get the snapshot's "owner" field.Targetproperties(PropertyName... fqn)Select or delete all given properties.TargetpropertiesOf(String... namespace)Select or delete all properties that belong to the given namespaces.<A> PropertyField<A>property(Value.ValueType<A> ev, String namespace, String name)Create a field to query properties.<A> PropertyField<A>property(Value.ValueType<A> ev, PropertyName fqn)ASelectQueryselect(Target... target)Determine what should be included in the result records, i.e.Field<String>seriesId()Get the snapshot's "seriesId" field.Targetsnapshot()Select or delete a snapshot.Predicatestorage(String storage)VersionFieldversion()Get the snapshot's "version" field.
-
-
-
Method Detail
-
select
ASelectQuery select(Target... target)
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 (
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.
- See Also:
ARecord
-
delete
ADeleteQuery delete(String owner, Target target)
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.
- Parameters:
owner- the name of the owner or the empty string
-
mediaPackageId
Predicate mediaPackageId(String mpId)
Create a predicate to match an snapshot's media package ID.
-
mediapackageId
Field<String> mediapackageId()
Get the snapshot's "mediaPackageId" field. Use it to create a predicate.
-
seriesId
Field<String> seriesId()
Get the snapshot's "seriesId" field. Use it to create a predicate.
-
organizationId
Predicate organizationId(String orgId)
Deprecated.useorganizationId().eq(orgId) insteadCreate a predicate to match a snapshot's organization ID.
-
organizationId
Field<String> organizationId()
Get the snapshot's "organizationId" field. Use it to create a predicate.
-
availability
Predicate availability(Availability availability)
-
hasPropertiesOf
Predicate hasPropertiesOf(String namespace)
Create a predicate that matches all snapshots with properties of the given namespace.
-
hasProperties
Predicate hasProperties()
Create a predicate that matches all snapshots with properties.
-
version
VersionField version()
Get the snapshot's "version" field. Use it to create a predicate.
-
property
<A> PropertyField<A> property(Value.ValueType<A> ev, String namespace, String name)
Create a field to query properties. Each parameter may be wild carded with the empty string.- Parameters:
namespace- the namespace or "" to select all namespacesname- the property name or "" to select all property names
-
property
<A> PropertyField<A> property(Value.ValueType<A> ev, PropertyName fqn)
-
snapshot
Target snapshot()
Select or delete a snapshot.
-
propertiesOf
Target propertiesOf(String... namespace)
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.
-
properties
Target properties(PropertyName... fqn)
Select or delete all given properties. Use an empty list of arguments to handle all properties of the media package.
-
-