Package 

Interface PanacheCompanionBase

    • Method Detail

      • getEntityManager

        @GenerateBridge() EntityManager getEntityManager()

        Returns the EntityManager for the <Entity> for extra operations (eg. CriteriaQueries)

      • findById

        @GenerateBridge(targetReturnTypeErased = true) Entity findById(Id id)

        Find an entity of this type by ID.

        Parameters:
        id - the ID of the entity to find.
      • findById

        @GenerateBridge(targetReturnTypeErased = true) Entity findById(Id id, LockModeType lockModeType)

        Find an entity of this type by ID and lock it.

        Parameters:
        id - the ID of the entity to find.
        lockModeType - the locking strategy to be used when retrieving the entity.
      • find

        @GenerateBridge() PanacheQuery<Entity> find(String query, Object params)

        Find entities using a query, with optional indexed parameters.

        Parameters:
        query - a query string
        params - optional sequence of indexed parameters
      • find

        @GenerateBridge() PanacheQuery<Entity> find(String query, Sort sort, Object params)

        Find entities using a query and the given sort options with optional indexed parameters.

        Parameters:
        query - a query string
        sort - the sort strategy to use
        params - optional sequence of indexed parameters
      • find

        @GenerateBridge() PanacheQuery<Entity> find(String query, Sort sort, Map<String, Object> params)

        Find entities using a query and the given sort options, with named parameters.

        Parameters:
        query - a query string
        sort - the sort strategy to use
        params - Map of indexed parameters
      • find

        @GenerateBridge() PanacheQuery<Entity> find(String query, Parameters params)

        Find entities using a query, with named parameters.

        Parameters:
        query - a query string
        params - Parameters of named parameters
      • find

        @GenerateBridge() PanacheQuery<Entity> find(String query, Sort sort, Parameters params)

        Find entities using a query and the given sort options, with named parameters.

        Parameters:
        query - a query string
        sort - the sort strategy to use
        params - Parameters of indexed parameters
      • findAll

        @GenerateBridge() PanacheQuery<Entity> findAll(Sort sort)

        Find all entities of this type, in the given order.

        Parameters:
        sort - the sort order to use
      • list

        @GenerateBridge() List<Entity> list(String query, Object params)

        Find entities matching a query, with optional indexed parameters. This method is a shortcut for find(query, params).list().

        Parameters:
        query - a query string
        params - optional sequence of indexed parameters
      • list

        @GenerateBridge() List<Entity> list(String query, Sort sort, Object params)

        Find entities matching a query and the given sort options, with optional indexed parameters. This method is a shortcut for find(query, sort, params).list().

        Parameters:
        query - a query string
        sort - the sort strategy to use
        params - optional sequence of indexed parameters
      • list

        @GenerateBridge() List<Entity> list(String query, Map<String, Object> params)

        Find entities matching a query, with named parameters. This method is a shortcut for find(query, params).list().

        Parameters:
        query - a query string
        params - Map of named parameters
      • list

        @GenerateBridge() List<Entity> list(String query, Sort sort, Map<String, Object> params)

        Find entities matching a query and the given sort options, with named parameters. This method is a shortcut for find(query, sort, params).list().

        Parameters:
        query - a query string
        sort - the sort strategy to use
        params - Map of indexed parameters
      • list

        @GenerateBridge() List<Entity> list(String query, Parameters params)

        Find entities matching a query, with named parameters. This method is a shortcut for find(query, params).list().

        Parameters:
        query - a query string
        params - Parameters of named parameters
      • list

        @GenerateBridge() List<Entity> list(String query, Sort sort, Parameters params)

        Find entities matching a query and the given sort options, with named parameters. This method is a shortcut for find(query, sort, params).list().

        Parameters:
        query - a query string
        sort - the sort strategy to use
        params - Parameters of indexed parameters
      • listAll

        @GenerateBridge() List<Entity> listAll()

        Find all entities of this type. This method is a shortcut for findAll().list().

      • listAll

        @GenerateBridge() List<Entity> listAll(Sort sort)

        Find all entities of this type, in the given order. This method is a shortcut for findAll(sort).list().

        Parameters:
        sort - the sort order to use
      • stream

        @GenerateBridge() Stream<Entity> stream(String query, Object params)

        Find entities matching a query, with optional indexed parameters. This method is a shortcut for find(query, params).stream(). It requires a transaction to work. Without a transaction, the underlying cursor can be closed before the end of the stream.

        Parameters:
        query - a query string
        params - optional sequence of indexed parameters
      • stream

        @GenerateBridge() Stream<Entity> stream(String query, Sort sort, Object params)

        Find entities matching a query and the given sort options, with optional indexed parameters. This method is a shortcut for find(query, sort, params).stream(). It requires a transaction to work. Without a transaction, the underlying cursor can be closed before the end of the stream.

        Parameters:
        query - a query string
        sort - the sort strategy to use
        params - optional sequence of indexed parameters
      • stream

        @GenerateBridge() Stream<Entity> stream(String query, Map<String, Object> params)

        Find entities matching a query, with named parameters. This method is a shortcut for find(query, params).stream(). It requires a transaction to work. Without a transaction, the underlying cursor can be closed before the end of the stream.

        Parameters:
        query - a query string
        params - Map of named parameters
      • stream

        @GenerateBridge() Stream<Entity> stream(String query, Sort sort, Map<String, Object> params)

        Find entities matching a query and the given sort options, with named parameters. This method is a shortcut for find(query, sort, params).stream(). It requires a transaction to work. Without a transaction, the underlying cursor can be closed before the end of the stream.

        Parameters:
        query - a query string
        sort - the sort strategy to use
        params - Map of indexed parameters
      • stream

        @GenerateBridge() Stream<Entity> stream(String query, Parameters params)

        Find entities matching a query, with named parameters. This method is a shortcut for find(query, params).stream(). It requires a transaction to work. Without a transaction, the underlying cursor can be closed before the end of the stream.

        Parameters:
        query - a query string
        params - Parameters of named parameters
      • stream

        @GenerateBridge() Stream<Entity> stream(String query, Sort sort, Parameters params)

        Find entities matching a query and the given sort options, with named parameters. This method is a shortcut for find(query, sort, params).stream(). It requires a transaction to work. Without a transaction, the underlying cursor can be closed before the end of the stream.

        Parameters:
        query - a query string
        sort - the sort strategy to use
        params - Parameters of indexed parameters
      • streamAll

        @GenerateBridge() Stream<Entity> streamAll()

        Find all entities of this type. This method is a shortcut for findAll().stream(). It requires a transaction to work. Without a transaction, the underlying cursor can be closed before the end of the stream.

      • streamAll

        @GenerateBridge() Stream<Entity> streamAll(Sort sort)

        Find all entities of this type, in the given order. This method is a shortcut for findAll(sort).stream(). It requires a transaction to work. Without a transaction, the underlying cursor can be closed before the end of the stream.

        Parameters:
        sort - the sort order to use
      • count

        @GenerateBridge() Long count()

        Counts the number of this type of entity in the database.

      • count

        @GenerateBridge() Long count(String query, Object params)

        Counts the number of this type of entity matching the given query, with optional indexed parameters.

        Parameters:
        query - a query string
        params - optional sequence of indexed parameters
      • count

        @GenerateBridge() Long count(String query, Map<String, Object> params)

        Counts the number of this type of entity matching the given query, with named parameters.

        Parameters:
        query - a query string
        params - Map of named parameters
      • count

        @GenerateBridge() Long count(String query, Parameters params)

        Counts the number of this type of entity matching the given query, with named parameters.

        Parameters:
        query - a query string
        params - Parameters of named parameters
      • deleteAll

        @GenerateBridge() Long deleteAll()

        Delete all entities of this type from the database.

        WARNING: the default implementation of this method uses a bulk delete query and ignores cascading rules from the JPA model.

      • delete

        @GenerateBridge() Long delete(String query, Object params)

        Delete all entities of this type matching the given query, with optional indexed parameters.

        WARNING: the default implementation of this method uses a bulk delete query and ignores cascading rules from the JPA model.

        Parameters:
        query - a query string
        params - optional sequence of indexed parameters
      • delete

        @GenerateBridge() Long delete(String query, Map<String, Object> params)

        Delete all entities of this type matching the given query, with named parameters.

        WARNING: the default implementation of this method uses a bulk delete query and ignores cascading rules from the JPA model.

        Parameters:
        query - a query string
        params - Map of named parameters
      • delete

        @GenerateBridge() Long delete(String query, Parameters params)

        Delete all entities of this type matching the given query, with named parameters.

        WARNING: the default implementation of this method uses a bulk delete query and ignores cascading rules from the JPA model.

        Parameters:
        query - a query string
        params - Parameters of named parameters
      • deleteById

        @GenerateBridge() Boolean deleteById(Id id)

        Delete an entity of this type by ID.

        Parameters:
        id - the ID of the entity to delete.
      • persist

         Unit persist(Iterable<Entity> entities)

        Persist all given entities.

        Parameters:
        entities - the entities to persist
      • persist

         Unit persist(Stream<Entity> entities)

        Persist all given entities.

        Parameters:
        entities - the entities to persist
      • persist

         Unit persist(Entity firstEntity, Entity entities)

        Persist all given entities.

        Parameters:
        entities - the entities to persist
      • update

        @GenerateBridge() Integer update(String query, Object params)

        Update all entities of this type matching the given query, with optional indexed parameters.

        Parameters:
        query - a query string
        params - optional sequence of indexed parameters
      • update

        @GenerateBridge() Integer update(String query, Map<String, Object> params)

        Update all entities of this type matching the given query, with named parameters.

        Parameters:
        query - a query string
        params - Map of named parameters
      • update

        @GenerateBridge() Integer update(String query, Parameters params)

        Update all entities of this type matching the given query, with named parameters.

        Parameters:
        query - a query string
        params - Parameters of named parameters
      • flush

        @GenerateBridge(targetReturnTypeErased = true) Unit flush()

        Flushes all pending changes to the database.