Data access objects

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:

  1. 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; ...

Get Spring Security - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.