#381 - Adapt examples to immutable object support.
Provide mutable property accessors to allow object mutation.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user