@@ -26,7 +26,7 @@ import lombok.With;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.annotation.PersistenceConstructor;
|
||||
import org.springframework.data.annotation.PersistenceCreator;
|
||||
|
||||
/**
|
||||
* Coarse classification for {@link LegoSet}s, like "Car", "Plane", "Building" and so on.
|
||||
@@ -34,7 +34,7 @@ import org.springframework.data.annotation.PersistenceConstructor;
|
||||
* @author Jens Schauder
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor(access = AccessLevel.PRIVATE, onConstructor = @__(@PersistenceConstructor))
|
||||
@AllArgsConstructor(access = AccessLevel.PRIVATE, onConstructor = @__(@PersistenceCreator))
|
||||
public class Category {
|
||||
|
||||
private final @Id @With Long id;
|
||||
|
||||
@@ -20,7 +20,7 @@ import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.annotation.PersistenceConstructor;
|
||||
import org.springframework.data.annotation.PersistenceCreator;
|
||||
|
||||
class Minion {
|
||||
@Id
|
||||
@@ -32,7 +32,7 @@ class Minion {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@PersistenceConstructor
|
||||
@PersistenceCreator
|
||||
private Minion(Long id, String name, Collection<Toy> toys) {
|
||||
|
||||
this.id = id;
|
||||
|
||||
@@ -20,7 +20,7 @@ import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.annotation.PersistenceConstructor;
|
||||
import org.springframework.data.annotation.PersistenceCreator;
|
||||
import org.springframework.data.annotation.Version;
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ class Minion {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@PersistenceConstructor
|
||||
@PersistenceCreator
|
||||
private Minion(Long id, String name, Collection<Toy> toys, int version) {
|
||||
|
||||
this.id = id;
|
||||
|
||||
@@ -28,7 +28,7 @@ import java.util.UUID;
|
||||
|
||||
import org.jmolecules.ddd.types.AggregateRoot;
|
||||
import org.jmolecules.ddd.types.Identifier;
|
||||
import org.springframework.data.annotation.PersistenceConstructor;
|
||||
import org.springframework.data.annotation.PersistenceCreator;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
@@ -36,7 +36,7 @@ import org.springframework.util.Assert;
|
||||
*/
|
||||
@Getter
|
||||
@ToString
|
||||
@AllArgsConstructor(access = AccessLevel.PRIVATE, onConstructor = @__(@PersistenceConstructor))
|
||||
@AllArgsConstructor(access = AccessLevel.PRIVATE, onConstructor = @__(@PersistenceCreator))
|
||||
public class Customer implements AggregateRoot<Customer, CustomerId> {
|
||||
|
||||
private final CustomerId id;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package example.springdata.mongodb.aggregation;
|
||||
|
||||
import org.springframework.data.annotation.PersistenceConstructor;
|
||||
import org.springframework.data.annotation.PersistenceCreator;
|
||||
|
||||
/**
|
||||
* A line item.
|
||||
@@ -26,7 +26,7 @@ import org.springframework.data.annotation.PersistenceConstructor;
|
||||
|
||||
public record LineItem(String caption, double price, int quantity) {
|
||||
|
||||
@PersistenceConstructor
|
||||
@PersistenceCreator
|
||||
public LineItem {
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.annotation.PersistenceConstructor;
|
||||
import org.springframework.data.annotation.PersistenceCreator;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
/**
|
||||
@@ -34,7 +34,7 @@ import org.springframework.data.mongodb.core.mapping.Document;
|
||||
* @author Mark Paluch
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor(onConstructor = @__(@PersistenceConstructor))
|
||||
@AllArgsConstructor(onConstructor = @__(@PersistenceCreator))
|
||||
@Document
|
||||
public class Order {
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import java.util.UUID;
|
||||
|
||||
import org.jmolecules.ddd.types.AggregateRoot;
|
||||
import org.jmolecules.ddd.types.Identifier;
|
||||
import org.springframework.data.annotation.PersistenceConstructor;
|
||||
import org.springframework.data.annotation.PersistenceCreator;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
@@ -35,7 +35,7 @@ import org.springframework.util.Assert;
|
||||
*/
|
||||
@Getter
|
||||
@ToString
|
||||
@AllArgsConstructor(access = AccessLevel.PRIVATE, onConstructor = @__(@PersistenceConstructor))
|
||||
@AllArgsConstructor(access = AccessLevel.PRIVATE, onConstructor = @__(@PersistenceCreator))
|
||||
public class Customer implements AggregateRoot<Customer, CustomerId> {
|
||||
|
||||
private final CustomerId id;
|
||||
|
||||
@@ -16,13 +16,13 @@
|
||||
package example.springdata.mongodb.people
|
||||
|
||||
import org.springframework.data.annotation.Id
|
||||
import org.springframework.data.annotation.PersistenceConstructor
|
||||
import org.springframework.data.annotation.PersistenceCreator
|
||||
|
||||
/**
|
||||
* An entity to represent a Person.
|
||||
*
|
||||
* @author Mark Paluch
|
||||
*/
|
||||
data class Person @PersistenceConstructor constructor(@Id val id: String?, val firstname: String? = "Walter", val lastname: String = "") {
|
||||
data class Person @PersistenceCreator constructor(@Id val id: String?, val firstname: String? = "Walter", val lastname: String = "") {
|
||||
constructor(firstname: String?, lastname: String) : this(null, firstname, lastname);
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
package example.springdata.mongodb.people;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.annotation.PersistenceConstructor;
|
||||
import org.springframework.data.annotation.PersistenceCreator;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
/**
|
||||
@@ -27,7 +27,7 @@ import org.springframework.data.mongodb.core.mapping.Document;
|
||||
@Document
|
||||
public record Person(@Id String id, String firstname, String lastname, int age) {
|
||||
|
||||
@PersistenceConstructor
|
||||
@PersistenceCreator
|
||||
public Person {
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
package example.springdata.mongodb.security;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.annotation.PersistenceConstructor;
|
||||
import org.springframework.data.annotation.PersistenceCreator;
|
||||
|
||||
/**
|
||||
* An entity to represent a {@link Person}.
|
||||
@@ -25,7 +25,7 @@ import org.springframework.data.annotation.PersistenceConstructor;
|
||||
*/
|
||||
public record Person(@Id String id, String firstname, String lastname) {
|
||||
|
||||
@PersistenceConstructor
|
||||
@PersistenceCreator
|
||||
public Person {
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ package example.springdata.multistore.shop;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import org.springframework.data.annotation.PersistenceConstructor;
|
||||
import org.springframework.data.annotation.PersistenceCreator;
|
||||
|
||||
/**
|
||||
* A line item.
|
||||
@@ -27,7 +27,7 @@ import org.springframework.data.annotation.PersistenceConstructor;
|
||||
* @author Oliver Gierke
|
||||
*/
|
||||
@Data
|
||||
@RequiredArgsConstructor(onConstructor = @__(@PersistenceConstructor))
|
||||
@RequiredArgsConstructor(onConstructor = @__(@PersistenceCreator))
|
||||
public class LineItem {
|
||||
|
||||
private final String caption;
|
||||
|
||||
@@ -22,7 +22,7 @@ import java.util.List;
|
||||
import lombok.Data;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import org.springframework.data.annotation.PersistenceConstructor;
|
||||
import org.springframework.data.annotation.PersistenceCreator;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
/**
|
||||
@@ -33,7 +33,7 @@ import org.springframework.data.mongodb.core.mapping.Document;
|
||||
* @author Oliver Gierke
|
||||
*/
|
||||
@Data
|
||||
@RequiredArgsConstructor(onConstructor = @__(@PersistenceConstructor))
|
||||
@RequiredArgsConstructor(onConstructor = @__(@PersistenceCreator))
|
||||
@Document
|
||||
public class Order {
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.annotation.PersistenceConstructor;
|
||||
import org.springframework.data.annotation.PersistenceCreator;
|
||||
import org.springframework.data.neo4j.core.schema.GeneratedValue;
|
||||
import org.springframework.data.neo4j.core.schema.Id;
|
||||
import org.springframework.data.neo4j.core.schema.RelationshipProperties;
|
||||
@@ -47,7 +47,7 @@ public class Roles {
|
||||
this(Collections.emptyList());
|
||||
}
|
||||
|
||||
@PersistenceConstructor
|
||||
@PersistenceCreator
|
||||
public Roles(List<String> roles) {
|
||||
this.roles = new ArrayList<>(roles);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user