In my jpa interface, i have the following code:
public interface ConsultationRequestRepository extends CrudRepository<ConsultationRequest, Integer> {
@Query("select * from ConsultationRequest where status = ?1")
List<ConsultationRequest> findRequestsByStatus(ConsultationStatus status);
}
but it complains with the error:
antlr.NoViableAltException: unexpected token: *
what is wrong in this code?
Try to change your query in the following way:
@Query("select c from ConsultationRequest c where c.status = ?1")
Or you can use native query:
@Query("select * from ConsultationRequest where status = ?1", nativeQuery = true)
More about using @Query
annotation you can find here
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments