Skip to content

Cannot use a parameter of type Class in custom queries #2510

Closed
@alienisty

Description

@alienisty

If a query method with custom query uses a parameter of type Class annotated with @param("name"), it is considered a dynamic projection parameter and it is not bound to the query parameter.
For example, for a polymorphic entity E, I would like to be able to express a query such as:

  @Query("from E e where type(e) = :type")
  <T> List<T> findAll(@Param("type") Class<T> type);

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions