Enum Class JPASearchStrategy

java.lang.Object
java.lang.Enum<JPASearchStrategy>
com.peterphi.std.guice.hibernate.webquery.impl.jpa.JPASearchStrategy
All Implemented Interfaces:
Serializable, Comparable<JPASearchStrategy>, Constable

public enum JPASearchStrategy extends Enum<JPASearchStrategy>
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Run the query, returning a sorted list of entities that match.
    Run a query that returns a count of the number of results (the same as count on ID)
    Run a query that returns a custom projection based on the fetch value of the WebQuery
    The result from the database will be an Object[] with the first few elements the same as fetch.
    Run the query, returning a sorted list of entities that match
    Run the query, returning a sorted list of entities having only the ID field(s) populated
    Run the query, returning a sorted list of IDs that match
    Run an ID query, then run a query to fetch back all the entity data for those IDs
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns true if this strategy will output full entities at the end of the process
    Returns the enum constant of this class with the specified name.
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • AUTO

      public static final JPASearchStrategy AUTO
      Run the query, returning a sorted list of entities that match. The actual underlying strategy may change between ENTITY and ID_THEN_QUERY_ENTITY depending on the query and entity configuration
    • ID

      public static final JPASearchStrategy ID
      Run the query, returning a sorted list of IDs that match
    • ENTITY

      public static final JPASearchStrategy ENTITY
      Run the query, returning a sorted list of entities that match
    • ENTITY_WRAPPED_ID

      public static final JPASearchStrategy ENTITY_WRAPPED_ID
      Run the query, returning a sorted list of entities having only the ID field(s) populated
    • ID_THEN_QUERY_ENTITY

      public static final JPASearchStrategy ID_THEN_QUERY_ENTITY
      Run an ID query, then run a query to fetch back all the entity data for those IDs
    • CUSTOM_PROJECTION

      public static final JPASearchStrategy CUSTOM_PROJECTION
      Run a query that returns a custom projection based on the fetch value of the WebQuery
      The result from the database will be an Object[] with the first few elements the same as fetch. N.B. the Object[] may be larger than the number of fetched columns (if, for example, the system had to add selections to satisfy SQL limitations - the most obvious case being for ORDER BYs)
    • COUNT_ONLY

      public static final JPASearchStrategy COUNT_ONLY
      Run a query that returns a count of the number of results (the same as count on ID)
  • Method Details

    • values

      public static JPASearchStrategy[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static JPASearchStrategy valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • isReturningFullEntity

      public boolean isReturningFullEntity()
      Returns true if this strategy will output full entities at the end of the process
      Returns: