filter

abstract fun filter(filterName: String, parameters: Parameters): PanacheQuery<Entity>
abstract fun filter(filterName: String, parameters: Map<String, Any>): PanacheQuery<Entity>

Enables a Hibernate filter during fetching of results for this query. Your filter must be declared with [FilterDef] on your entity or package, and enabled with [Filter] on your entity.

WARNING: setting filters can only be done on the underlying Hibernate [Session] and so this will modify the session's filters for the duration of obtaining the results (not while building the query). Enabled filters will be removed from the session afterwards, but no effort is made to preserve filters enabled on the session outside of this API.

Return

this query, modified

Parameters

filterName

The name of the filter to enable

parameters

The set of parameters for the filter, if the filter requires parameters


abstract fun filter(filterName: String): PanacheQuery<Entity>

Enables a Hibernate filter during fetching of results for this query. Your filter must be declared with [FilterDef] on your entity or package, and enabled with [Filter] on your entity.

WARNING: setting filters can only be done on the underlying Hibernate [Session] and so this will modify the session's filters for the duration of obtaining the results (not while building the query). Enabled filters will be removed from the session afterwards, but no effort is made to preserve filters enabled on the session outside of this API.

Return

this query, modified

Parameters

filterName

The name of the filter to enable