We need to refactor the JdbcEventDao.java file with a new name, JpaEventDao.java, so we can replace the JDBC SQL code with our new Spring Data code. Let's take a look at the following steps:
- Specifically, we need to add the new EventRepository interface, and replace the SQL code with the new ORM repository, as shown in the following code:
//com/packtpub/springsecurity/dataaccess/JpaEventDao.java package com.packtpub.springsecurity.dataaccess; import com.packtpub.springsecurity.domain.CalendarUser; import com.packtpub.springsecurity.domain.Event; import com.packtpub.springsecurity.repository.EventRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Example; ...