vadimkolodingg commented on code in PR #7658:
URL: https://github.com/apache/ignite-3/pull/7658#discussion_r2855198933


##########
modules/api/src/main/java/org/apache/ignite/table/mapper/MapperBuilder.java:
##########
@@ -152,11 +151,21 @@ private void ensureNotStale() {
      * @throws IllegalArgumentException If a field is {@code null} or if the 
class has no declared field with the given name.
      */
     private String requireValidField(String fieldName) {
-        try {
-            if (fieldName == null || targetType.getDeclaredField(fieldName) == 
null) {
-                throw new IllegalArgumentException("Mapping for a column 
already exists: " + fieldName);
-            }
-        } catch (NoSuchFieldException e) {
+        if (fieldName == null) {

Review Comment:
   To keep things simple, I'd rather left `getAllFields` as is, and use here 
`FieldAccessor#getField` that traverse hierarchy. This is different module, 
just copy-paste method here and maybe make it nullable (no need to extract to 
the utils for a single duplicate).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to