
上QQ阅读APP看书,第一时间看更新
Spring Data repositories of MongoDB
We now have only a few changes to make to refactor from a JPA implementation to a MongoDB implementation. We will begin by refactoring our CalendarUserRepository.java file by changing the interface that our repository extends, as follows:
//com/packtpub/springsecurity/repository/CalendarUserRepository.java
...
import org.springframework.data.mongodb.repository.MongoRepository;
public interface CalendarUserRepository extends MongoRepository
<CalendarUser, Integer> {
...
This same change needs to be applied to the EventRepository.java file and the RoleRepository.java files accordingly.
If you need help with any of these changes, remember the source for chapter05.05 will have the completed code available for your reference.