From 62642c3ffc8a80692c4ffaea5f89f80465fe17fd Mon Sep 17 00:00:00 2001 From: Bence Gelei <54545024+bencegelei@users.noreply.github.com> Date: Mon, 20 Jan 2025 15:24:23 +0100 Subject: [PATCH] JNG-6082 Refactor required validation and default value processing (#68) [2025-01-19 19:54:06 +0100] bence.gelei: restore pom.xml change [2025-01-16 15:08:44 +0100] bence.gelei: apply instead of copy [2025-01-15 19:09:37 +0100] bence.gelei: rename [2025-01-15 17:28:56 +0100] bence.gelei: default populator added [2025-01-13 11:52:34 +0100] bence.gelei: payload traverser added [2025-01-13 11:21:45 +0100] bence.gelei: JNG-6082 Initial feature commit --- src/main/java/hu/blackbelt/judo/dao/api/DAO.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/hu/blackbelt/judo/dao/api/DAO.java b/src/main/java/hu/blackbelt/judo/dao/api/DAO.java index db55e24..38a4bf7 100644 --- a/src/main/java/hu/blackbelt/judo/dao/api/DAO.java +++ b/src/main/java/hu/blackbelt/judo/dao/api/DAO.java @@ -65,6 +65,17 @@ public interface DAO { */ Payload getDefaultsOf(EClass clazz); + /** + *

Apply the default values in the given payload based on the specified transfer object type.

+ *

The default values are also applied by traversing through its relations.

+ *

NOTE: additional fields with default values on entity type that are not targeted by a mapping from given transfer object (clazz) mapping, + * will not be applied

+ * + * @param clazz transfer object type + * @param payload payload + */ + void applyDefaultsOf(EClass clazz, Payload payload); + /** * Get range of a given transfer object relation. *