Class DmlUtils


  • public class DmlUtils
    extends Object
    DML utility methods.
    • Method Detail

      • convert

        public static Object convert​(Object val,
                                     GridQueryRowDescriptor desc,
                                     Class<?> expCls,
                                     int type,
                                     String columnName)
        Convert value to column's expected type by means of H2.
        Parameters:
        val - Source value.
        desc - Row descriptor.
        expCls - Expected value class.
        type - Expected column type to convert to.
        Returns:
        Converted object.
      • isBatched

        public static boolean isBatched​(SqlFieldsQuery qry)
        Check whether query is batched.
        Parameters:
        qry - Query.
        Returns:
        True if batched.
      • processSelectResult

        public static UpdateResult processSelectResult​(UpdatePlan plan,
                                                       Iterable<List<?>> cursor,
                                                       int pageSize)
                                                throws IgniteCheckedException
        Parameters:
        plan - Update plan.
        cursor - Cursor over select results.
        pageSize - Page size.
        Returns:
        Pair [number of successfully processed items; keys that have failed to be processed]
        Throws:
        IgniteCheckedException - if failed.
      • chainException

        public static SQLException chainException​(SQLException main,
                                                  SQLException add)
        Adds exception to the chain.
        Parameters:
        main - Exception to add another exception to.
        add - Exception which should be added to chain.
        Returns:
        Chained exception.
      • setKeepBinaryContext

        public static CacheOperationContext setKeepBinaryContext​(GridCacheContext<?,​?> cctx)
        Makes current operation context as keepBinary.
        Parameters:
        cctx - Cache context.
        Returns:
        Old operation context.
      • restoreKeepBinaryContext

        public static void restoreKeepBinaryContext​(GridCacheContext<?,​?> cctx,
                                                    CacheOperationContext oldOpCtx)
        Restore previous binary context.
        Parameters:
        cctx - Cache context.
        oldOpCtx - Old operation context.