O'Reilly logo

Spring Security - Third Edition by Peter Mularien, Robert Winch, Mick Knutson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required