Entity looks like this:
@Getter
@Setter
@Entity
public class Application {
@Id
private Long id;
@Enumerated(EnumType.STRING)
private ApplicationStatus status
To extend @Aivaras answer: If you want to use list of statuses, SpEL ecpression is slightly different - you need to do projection:
public interface ApplicationRepository extends JpaRepository {
@Query(nativeQuery = true, value = "SELECT app FROM #{#entityName} AS app WHERE app.status in :#{#statuses.![name()]}")
List find(@Param("statuses") List statuses);
}
Note the change of expression to
#{#statuses.![name()]}