diff --git a/jdbc/jmolecules/pom.xml b/jdbc/jmolecules/pom.xml
index 05e160a1..39265ab0 100644
--- a/jdbc/jmolecules/pom.xml
+++ b/jdbc/jmolecules/pom.xml
@@ -15,7 +15,7 @@
2021.0.0-SNAPSHOT
1.2.0
- 0.2.0
+ 0.4.0-SNAPSHOT
diff --git a/jdbc/jmolecules/src/main/java/example/springdata/jdbc/jmolecules/customer/Customer.java b/jdbc/jmolecules/src/main/java/example/springdata/jdbc/jmolecules/customer/Customer.java
index 30b279ed..98dafb05 100644
--- a/jdbc/jmolecules/src/main/java/example/springdata/jdbc/jmolecules/customer/Customer.java
+++ b/jdbc/jmolecules/src/main/java/example/springdata/jdbc/jmolecules/customer/Customer.java
@@ -21,7 +21,6 @@ import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
-import lombok.Value;
import java.util.ArrayList;
import java.util.List;
@@ -48,7 +47,7 @@ public class Customer implements AggregateRoot {
Assert.notNull(address, "Address must not be null!");
- this.id = new CustomerId(UUID.randomUUID().toString());
+ this.id = new CustomerId(UUID.randomUUID());
this.firstname = firstname;
this.lastname = lastname;
@@ -57,6 +56,5 @@ public class Customer implements AggregateRoot {
this.addresses.add(address);
}
- public record CustomerId(String id) implements Identifier {
- }
+ public record CustomerId(UUID id) implements Identifier {}
}
diff --git a/jdbc/jmolecules/src/main/java/example/springdata/jdbc/jmolecules/order/Order.java b/jdbc/jmolecules/src/main/java/example/springdata/jdbc/jmolecules/order/Order.java
index 77b34ef2..2a377dc3 100644
--- a/jdbc/jmolecules/src/main/java/example/springdata/jdbc/jmolecules/order/Order.java
+++ b/jdbc/jmolecules/src/main/java/example/springdata/jdbc/jmolecules/order/Order.java
@@ -25,7 +25,6 @@ import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
-import lombok.Value;
import org.jmolecules.ddd.types.AggregateRoot;
import org.jmolecules.ddd.types.Association;
import org.jmolecules.ddd.types.Identifier;
@@ -47,7 +46,7 @@ public class Order implements AggregateRoot {
public Order(Customer customer) {
- this.id = OrderId.of(UUID.randomUUID());
+ this.id = new OrderId(UUID.randomUUID());
this.customer = Association.forAggregate(customer);
this.lineItems = new ArrayList<>();
}
@@ -61,13 +60,5 @@ public class Order implements AggregateRoot {
return this;
}
- @Value(staticConstructor = "of")
- public static class OrderId implements Identifier {
-
- UUID orderId;
-
- public static OrderId create() {
- return OrderId.of(UUID.randomUUID());
- }
- }
+ public record OrderId(UUID id) implements Identifier {}
}
diff --git a/mongodb/jmolecules/pom.xml b/mongodb/jmolecules/pom.xml
index fb4ae9fb..a6dd21a3 100644
--- a/mongodb/jmolecules/pom.xml
+++ b/mongodb/jmolecules/pom.xml
@@ -15,7 +15,7 @@
2021.0.0-SNAPSHOT
1.2.0
- 0.2.0
+ 0.4.0-SNAPSHOT
diff --git a/mongodb/jmolecules/src/main/java/example/springdata/mongodb/customer/Customer.java b/mongodb/jmolecules/src/main/java/example/springdata/mongodb/customer/Customer.java
index 7046bbee..722bcbf9 100644
--- a/mongodb/jmolecules/src/main/java/example/springdata/mongodb/customer/Customer.java
+++ b/mongodb/jmolecules/src/main/java/example/springdata/mongodb/customer/Customer.java
@@ -20,7 +20,6 @@ import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.ToString;
-import lombok.Value;
import java.util.ArrayList;
import java.util.List;
@@ -47,7 +46,7 @@ public class Customer implements AggregateRoot {
Assert.notNull(address, "Address must not be null!");
- this.id = CustomerId.of(UUID.randomUUID());
+ this.id = new CustomerId(UUID.randomUUID());
this.firstname = firstname;
this.lastname = lastname;
@@ -56,8 +55,5 @@ public class Customer implements AggregateRoot {
this.addresses.add(address);
}
- @Value(staticConstructor = "of")
- public static class CustomerId implements Identifier {
- private final UUID id;
- }
+ public record CustomerId(UUID id) implements Identifier {}
}
diff --git a/mongodb/jmolecules/src/main/java/example/springdata/mongodb/order/Order.java b/mongodb/jmolecules/src/main/java/example/springdata/mongodb/order/Order.java
index 455f63e8..9294d487 100644
--- a/mongodb/jmolecules/src/main/java/example/springdata/mongodb/order/Order.java
+++ b/mongodb/jmolecules/src/main/java/example/springdata/mongodb/order/Order.java
@@ -20,7 +20,6 @@ import example.springdata.mongodb.customer.Customer.CustomerId;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.ToString;
-import lombok.Value;
import java.util.ArrayList;
import java.util.List;
@@ -44,7 +43,7 @@ public class Order implements AggregateRoot {
public Order(Customer customer) {
- this.id = OrderId.of(UUID.randomUUID());
+ this.id = new OrderId(UUID.randomUUID());
this.customer = Association.forAggregate(customer);
this.lineItems = new ArrayList<>();
}
@@ -58,13 +57,5 @@ public class Order implements AggregateRoot {
return this;
}
- @Value(staticConstructor = "of")
- public static class OrderId implements Identifier {
-
- UUID orderId;
-
- public static OrderId create() {
- return OrderId.of(UUID.randomUUID());
- }
- }
+ public static record OrderId(UUID id) implements Identifier {}
}