You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/12/02 10:08:05 UTC

[GitHub] [ignite-3] ptupitsyn commented on a change in pull request #455: IGNITE-15784 Mapper support arbitrary serializable user pojo.

ptupitsyn commented on a change in pull request #455:
URL: https://github.com/apache/ignite-3/pull/455#discussion_r760940470



##########
File path: modules/api/src/main/java/org/apache/ignite/table/mapper/DefaultColumnMapper.java
##########
@@ -21,7 +21,7 @@
 import org.jetbrains.annotations.NotNull;
 
 /**
- * Simple mapper implementation that map a column to a class field.
+ * Mapper implementation which maps object fields to the columns by their names.

Review comment:
       I think we should have two-way mapping, column -> field and field -> column.
   
   We know the schema on the client side (column names and their order). We don't know defaults for now, but I don't think they are required.
   
   It should be easy to write the row in correct order from an object if we have `column -> field` mapping:
   
   ```
   for (var col : schema.columns()) {
       var fieldName = mapper.fieldForColumn(col.name());
       if (fieldName == null)
           packNil();
       else
           packValue(...);
   }
   ```




-- 
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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org