Using a custom MSSQL query in spring

Using a custom MSSQL query in spring

I'm trying to run a custom query in spring with an MSSQL DB:

I'm trying to run a custom query in spring with an MSSQL DB:

@Query(value = "SELECT my_id, date, name " +
    "FROM my_events " +
    "WHERE name == :name " +
    "AND date between :starttime and :endtime " +
    "ORDER BY date DESC",
    nativeQuery = true)
List<myDAO> findByNameAndDateBetweenOrderByDateDesc (
    @Param("name")String name,
    @Param("starttime")String starttime,
    @Param("endtime")String endtime
);

When running the application without the custom query I'm getting:

Name for parameter binding must not be null or empty! On JDKs < 8, you need to use @Param for named parameters, on JDK 8 or better, be sure to compile with -parameters.; nested exception is java.lang.IllegalArgumentException: Name for parameter binding must not be null or empty! On JDKs < 8, you need to use @Param for named parameters, on JDK 8 or better, be sure to compile with -parameters.

When running the application without the @Query annotation (using the CrudRepository) it works fine.

The query will be changed to a more complicated query once I figure out the simplified one above, this is why I can't use the CrudRepository function.

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Spring Boot Tutorials - Spring Boot Full Course

Spring Boot Tutorials | Full Course - What is Spring? Spring Boot is an open source Java-based framework used to create a Micro Service. Spring Boot contains a comprehensive infrastructure support for developing a micro service and enables you to develop enterprise-ready applications that you can “just run”.

SQL Server Tutorial For Beginners - Learn MS SQL Server with Examples

SQL Server Tutorial For Beginners, Microsoft SQL Server Tutorial, SQL Server Training. Microsoft SQL Server explains all the fundamentals of MS SQL Server with examples. What is DBMS? What is SQL? What is SQL Server? SQL Server Installation

Build an OAuth 2.0 Authorization Server With Spring Boot and Spring Security

Learn more about building an OAuth 2.0 authorization server with Spring Boot and Spring Security.