Class QueryExecutorImpl

java.lang.Object
ch.tocco.nice2.scripting.impl.groovy.variable.QueryExecutorImpl
All Implemented Interfaces:
QueryExecutor

@Component public class QueryExecutorImpl extends Object implements QueryExecutor
  • Constructor Details

  • Method Details

    • findEntity

      public <E extends Entity> E findEntity(Class<E> entityClass, PrimaryKey key)
      Description copied from interface: QueryExecutor
      helper method to find an entity by a key
      Specified by:
      findEntity in interface QueryExecutor
    • findAll

      public <E extends Entity> List<E> findAll(Class<E> entityClass)
      Description copied from interface: QueryExecutor
      helper method to get all entities of a specific class
      Specified by:
      findAll in interface QueryExecutor
    • findLookupEntity

      @Nullable public <E extends Entity> E findLookupEntity(Class<E> entityClass, String uniqueId)
      The actual entity class needs to be used, so that static compilation is possible. If the method would return Entity the compiler would not know the properties of the returned entity.
      Specified by:
      findLookupEntity in interface QueryExecutor
    • find

      public <E extends Entity> List<E> find(Class<E> entityClass, String condition)
      Description copied from interface: QueryExecutor
      helper method to find entities by the provided TQL condition.
      Specified by:
      find in interface QueryExecutor
    • find

      public <E extends Entity> List<E> find(Class<E> entityClass, String condition, String order)
      Description copied from interface: QueryExecutor
      helper method to find entities by the provided TQL condition.
      Specified by:
      find in interface QueryExecutor
    • count

      public <E extends Entity> long count(Class<E> entityClass, String condition)
      Description copied from interface: QueryExecutor
      helper method to count results found by the provided TQL condition.
      Specified by:
      count in interface QueryExecutor