ptupitsyn commented on code in PR #4438:
URL: https://github.com/apache/ignite-3/pull/4438#discussion_r1776670271


##########
modules/client-common/src/main/java/org/apache/ignite/internal/client/proto/pojo/PojoConverter.java:
##########
@@ -0,0 +1,195 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.client.proto.pojo;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.math.BigDecimal;
+import java.time.Duration;
+import java.time.Instant;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.Period;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.UUID;
+import org.apache.ignite.table.Tuple;
+import org.jetbrains.annotations.Nullable;
+
+/** Converts POJO to Tuple and back. */
+public class PojoConverter {
+
+    /**
+     * Converts POJO to Tuple. Supports public non-static fields, public 
non-static getter methods starting with "get" (or "is" for boolean
+     * type) followed by the capital letter.
+     *
+     * @param obj POJO to convert.
+     * @return Tuple with columns corresponding to supported fields of the 
POJO.
+     * @throws PojoConversionException If conversion failed.
+     */
+    public static Tuple toTuple(Object obj) throws PojoConversionException {

Review Comment:
   Ideally, we should convert directly to `BinaryTuple`, and avoid intermediate 
`Tuple`. We can do that as a separate ticket to limit the scope here.



-- 
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