Annotate the Book class, 'new' property with the Spring Data @Transient annotation to prevent serialization.

This commit is contained in:
John Blum
2018-06-22 16:15:37 -07:00
parent a0c424ef82
commit 1aad7adff6

View File

@@ -19,6 +19,7 @@ package example.app.model;
import java.time.LocalDate;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.Transient;
import org.springframework.data.gemfire.mapping.annotation.Region;
import lombok.Data;
@@ -51,6 +52,7 @@ public class Book {
@NonNull
private String title;
@Transient
public boolean isNew() {
return getIsbn() == null;
}