Java Magazine, Jan/Feb 2018
ORACLE COM JAVAMAGAZINE JANUARY FEBRUARY 2018 65 reactive programming Data Access with Reactive Spring Data Modules The most recent release of Spring Data debuts support for reactive data access when that is supported in the underlying datastores such as MongoDB Cassandra Redis and Couchbase The release also introduces new reactive repository and template implementations Because you have the reactive MongoDB driver and Spring Data module on the classpath lets use them to manage some data Create a new entity called Book as shown in Listing 6 Listing 6 A MongoDB @ Document entity Book package com example libraryservice import lombok AllArgsConstructor import lombok Data import lombok NoArgsConstructor import org springframework data annotation Id import org springframework data mongodb core mapping Document @ Document @ Data @ AllArgsConstructor @ NoArgsConstructor public class Book @ Id private String id private String title private String author
You must have JavaScript enabled to view digital editions.