From 2b8fd79fcee00729e129f81469e1a8ee36002df5 Mon Sep 17 00:00:00 2001 From: Kenny Bastani Date: Sat, 31 Dec 2016 05:05:49 -0500 Subject: [PATCH] Refactored value object to entity, definition was backwards --- order/order-web/src/main/java/demo/order/LineItem.java | 7 +++---- .../src/main/java/demo/domain/Aggregate.java | 4 ++-- .../src/main/java/demo/domain/Commodity.java | 2 +- .../src/main/java/demo/domain/Entity.java | 6 +++--- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/order/order-web/src/main/java/demo/order/LineItem.java b/order/order-web/src/main/java/demo/order/LineItem.java index 58d22c9..d232d68 100644 --- a/order/order-web/src/main/java/demo/order/LineItem.java +++ b/order/order-web/src/main/java/demo/order/LineItem.java @@ -1,15 +1,14 @@ package demo.order; import com.fasterxml.jackson.annotation.JsonIgnore; -import demo.domain.Value; +import demo.domain.Entity; -import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; -@Entity -public class LineItem implements Value { +@javax.persistence.Entity +public class LineItem implements Entity { @Id @GeneratedValue(strategy = GenerationType.AUTO) diff --git a/spring-boot-starters/spring-boot-starter-data-events/src/main/java/demo/domain/Aggregate.java b/spring-boot-starters/spring-boot-starter-data-events/src/main/java/demo/domain/Aggregate.java index def4fe2..0d81667 100644 --- a/spring-boot-starters/spring-boot-starter-data-events/src/main/java/demo/domain/Aggregate.java +++ b/spring-boot-starters/spring-boot-starter-data-events/src/main/java/demo/domain/Aggregate.java @@ -21,14 +21,14 @@ import java.util.stream.Collectors; import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo; /** - * An {@link Aggregate} is an entity that contains references to one or more other {@link Value} objects. Aggregates + * An {@link Aggregate} is an entity that contains references to one or more other {@link Entity} objects. Aggregates * may contain a collection of references to a {@link Command}. All command references on an aggregate should be * explicitly typed. * * @author Kenny Bastani */ public abstract class Aggregate extends ResourceSupport implements - Value { + Entity { @JsonProperty("id") public abstract ID getIdentity(); diff --git a/spring-boot-starters/spring-boot-starter-data-events/src/main/java/demo/domain/Commodity.java b/spring-boot-starters/spring-boot-starter-data-events/src/main/java/demo/domain/Commodity.java index fc55a31..13ade4d 100644 --- a/spring-boot-starters/spring-boot-starter-data-events/src/main/java/demo/domain/Commodity.java +++ b/spring-boot-starters/spring-boot-starter-data-events/src/main/java/demo/domain/Commodity.java @@ -1,7 +1,7 @@ package demo.domain; /** - * A {@link Commodity} object is a {@link Value} object that is also an {@link Aggregate} root. A commodity object + * A {@link Commodity} object is a {@link Entity} object that is also an {@link Aggregate} root. A commodity object * describes all aspects of an aggregate and is both stateless and immutable. A commodity is a locator that connects * relationships of a value object to a {@link Provider}. *

diff --git a/spring-boot-starters/spring-boot-starter-data-events/src/main/java/demo/domain/Entity.java b/spring-boot-starters/spring-boot-starter-data-events/src/main/java/demo/domain/Entity.java index 54d39d3..7829d2a 100644 --- a/spring-boot-starters/spring-boot-starter-data-events/src/main/java/demo/domain/Entity.java +++ b/spring-boot-starters/spring-boot-starter-data-events/src/main/java/demo/domain/Entity.java @@ -6,11 +6,11 @@ import org.springframework.hateoas.Identifiable; import java.io.Serializable; /** - * {@link Value} objects are wrappers that contain the serializable properties that uniquely identify an entity. - * Value objects contain a collection of relationships. Value objects contain a collection of comparison operators. + * {@link Entity} objects are wrappers that contain the serializable properties that uniquely identify an entity. + * Entities contain a collection of relationships. Entities contain a collection of comparison operators. * The default identity comparator evaluates true if the compared objects have the same identifier. * * @author Kenny Bastani */ -public interface Value extends Identifiable { +public interface Entity extends Identifiable { }