java.lang.Object
ch.tocco.nice2.persist.core.api.exec.tasks2.QueryTask
All Implemented Interfaces:
PersistTask<Query,Iterable<Entity>>, PersistTaskIterable<Query,Entity>

@Deprecated public class QueryTask extends Object implements PersistTaskIterable<Query,Entity>
Deprecated.
use QueryBuilderFactory directly
  • Field Details

  • Method Details

    • queryForAll

      public static OptionalTask<String,Query> queryForAll()
      Deprecated.
      Return a task that creates a “query-for-all“ for the given entity model.
    • executeQuery

      public static QueryTask executeQuery()
      Deprecated.
      Return a task that executes a given query returning a list of entities. To access the EntityList use getEntityList().
    • getKeys

      public static PersistTask<Query,PrimaryKey[]> getKeys()
      Deprecated.
      a task that gets the keys from a query
      Returns:
      the task
    • compileQuery

      public static OptionalTask<String,Query> compileQuery()
      Deprecated.
      Compile a query given as string into a query. This is usually composed with executeQuery() to execute the query. Note that parameters must be set manually (by a subsequent task for example).
    • buildQuery

      public static OptionalTask<QueryBuilder,Query> buildQuery()
      Deprecated.
      Builds a query given a query builder object. This is usually composed with executeQuery() to execute the query.
    • buildAndExecuteQuery

      public static PersistTaskIterable<QueryBuilder,Entity> buildAndExecuteQuery()
      Deprecated.
      builds a query and executes it this is a simple composition of buildQuery() and executeQuery()
      Returns:
      a PersistTaskIterable which accepts a QueryBuilder and returns Entities
    • buildAndGetKeys

      public static PersistTask<QueryBuilder,PrimaryKey[]> buildAndGetKeys()
      Deprecated.
      builds a query and then gets the keys from it
      Returns:
      the keys
    • compileCondition

      public static OptionalTask<String,Condition> compileCondition(String entityName)
      Deprecated.
      compile a String to a Condition
      Parameters:
      entityName - the entity model for which the condition is written
      Returns:
      a task that accepts a String and returns a Condition
    • createQueryBuilderFromCondition

      public static OptionalTask<Condition,QueryBuilder> createQueryBuilderFromCondition(String entityName)
      Deprecated.
      creates a QueryBuilder from a Condition Condition does not provide an entity name, so we need to provide one
      Parameters:
      entityName - the entity model which the query builder should look for
      Returns:
      a task that accepts a Condition and returns a QueryBuilder
    • run

      public Iterable<Entity> run(Optional<Query> query, CommandContext commandContext) throws Exception
      Deprecated.
      Specified by:
      run in interface PersistTask<Query,Iterable<Entity>>
      Throws:
      Exception
    • getEntityList

      public PersistTask<Query,EntityList> getEntityList()
      Deprecated.
      Make a task that returns the `EntityList` instead of an iterable of entities.
    • verify

      protected void verify(EntityList list, Mode<?> mode)
      Deprecated.
    • toString

      public String toString()
      Deprecated.
      Overrides:
      toString in class Object