Move off deprecated code.

See #659
This commit is contained in:
Mark Paluch
2023-04-24 13:46:08 +02:00
parent 16a12a7755
commit f051de145e
13 changed files with 26 additions and 26 deletions

View File

@@ -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 {
}

View File

@@ -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 {

View File

@@ -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;

View File

@@ -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);
}

View File

@@ -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 {
}

View File

@@ -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 {
}