#381 - Adapt examples to immutable object support.

Provide mutable property accessors to allow object mutation.
This commit is contained in:
Mark Paluch
2018-07-26 11:07:42 +02:00
parent e2d2bdf6bc
commit 1c56cf8fba
5 changed files with 29 additions and 14 deletions

View File

@@ -15,7 +15,7 @@
*/
package example.springdata.mongodb.projections;
import lombok.Value;
import lombok.Data;
import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;
@@ -23,11 +23,17 @@ import org.springframework.data.mongodb.core.mapping.Document;
/**
* @author Oliver Gierke
* @author Mark Paluch
*/
@Value
@Data
@Document
class Customer {
@Id ObjectId id = new ObjectId();
String firstname, lastname;
public Customer(String firstname, String lastname) {
this.firstname = firstname;
this.lastname = lastname;
}
}