Class DmlUtils
- java.lang.Object
-
- org.apache.ignite.internal.processors.query.h2.dml.DmlUtils
-
public class DmlUtils extends Object
DML utility methods.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SQLExceptionchainException(SQLException main, SQLException add)Adds exception to the chain.static Objectconvert(Object val, GridQueryRowDescriptor desc, Class<?> expCls, int type, String columnName)Convert value to column's expected type by means of H2.static booleanisBatched(SqlFieldsQuery qry)Check whether query is batched.static UpdateResultprocessSelectResult(UpdatePlan plan, Iterable<List<?>> cursor, int pageSize)static List<UpdateResult>processSelectResultBatched(UpdatePlan plan, List<List<List<?>>> rows, int pageSize)Performs the planned update.static voidrestoreKeepBinaryContext(GridCacheContext<?,?> cctx, CacheOperationContext oldOpCtx)Restore previous binary context.static CacheOperationContextsetKeepBinaryContext(GridCacheContext<?,?> cctx)Makes current operation context as keepBinary.
-
-
-
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:
Trueif 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.
-
processSelectResultBatched
public static List<UpdateResult> processSelectResultBatched(UpdatePlan plan, List<List<List<?>>> rows, int pageSize) throws IgniteCheckedException
Performs the planned update.- Parameters:
plan- Update plan.rows- Rows to update.pageSize- Page size.- Returns:
Listof update results.- 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.
-
-