Vijai :
I am using the below @Query
annotation to get the first few record from MS-SQL. It's showing error saying "< operator > or AS expected..."
@Query("SELECT Top 1 * FROM NEVS010_VEH_ACTV_COMMAND C WHERE C.EVS014_VIN = :vin ORDER BY C.EVS010_CREATE_S DESC")
CommandStatus findCommandStatusByVinOrderByCreatedTimestampDesc(@Param("vin") String vin);
Vijai :
Since the query is SQL (and not JPQL) one needs to set nativeQuery = true
in the annotation:
@Query(nativeQuery = true, value = "SELECT Top 1 * FROM NEVS010_VEH_ACTV_COMMAND C WHERE C.EVS014_VIN = :vin ORDER BY C.EVS010_CREATE_S DESC")
CommandStatus findCommandStatusByVinOrderByCreatedTimestampDesc(@Param("vin") String vin);