As we have seen in the earlier chapters, using a Spring Data project for our database mapping can greatly simplify our work. So, to keep things consistent, we are going to refactor our JDBC-based PersistentTokenRepository interface that uses JdbcTokenRepositoryImpl to one that is JPA-based. We will do so by performing the following steps:
- First, let's create a domain object to hold the persistent logins, as shown in the following code snippet:
//src/main/java/com/packtpub/springsecurity/domain/ PersistentLogin.java import org.springframework.security.web.authentication.rememberme. PersistentRememberMeToken; import javax.persistence.*; import java.io.Serializable; import java.util.Date; @Entity @Table(name ...