if (updateClause != null) { List<Object> value = new ArrayList<Object>(); value.add(updateClause.getValue()); return value;
if (c.getValue() instanceof String) String func = c.getValue().toString(); func = func.replaceAll(" ", ""); if (func.toUpperCase().matches(FUNCTION_KEYWORDS[i])) if (c.getValue() instanceof String && c.getValue().toString().toUpperCase().matches(FUNCTION_KEYWORDS[i])) if (c.getValue().toString().toUpperCase().startsWith("INCREMENT(")) String val = c.getValue().toString().toUpperCase(); val = val.substring(10, val.indexOf(")")); update.put("$inc", new BasicDBObject(columName, Integer.valueOf(val))); else if (c.getValue().toString().toUpperCase().startsWith("DECREMENT(")) String val = c.getValue().toString().toUpperCase(); val = val.substring(10, val.indexOf(")")); update.put("$inc", new BasicDBObject(columName, -Integer.valueOf(val))); update.put(columName, c.getValue());
/** * Inits the update clause. */ private void initUpdateClause() { for (UpdateClause updateClause : updateClauseQueue) { onTypedParameter(updateClause.getValue(), updateClause, updateClause.getProperty().trim()); } }
if (c.getValue() instanceof String) String func = c.getValue().toString(); func = func.replaceAll(" ", ""); if (func.toUpperCase().matches(FUNCTION_KEYWORDS[i])) if (c.getValue() instanceof String && c.getValue().toString().toUpperCase().matches(FUNCTION_KEYWORDS[i])) if (c.getValue().toString().toUpperCase().startsWith("INCREMENT(")) String val = c.getValue().toString().toUpperCase(); val = val.substring(10, val.indexOf(")")); update.put("$inc", new BasicDBObject(columName, Integer.valueOf(val))); else if (c.getValue().toString().toUpperCase().startsWith("DECREMENT(")) String val = c.getValue().toString().toUpperCase(); val = val.substring(10, val.indexOf(")")); update.put("$inc", new BasicDBObject(columName, -Integer.valueOf(val))); update.put(columName, c.getValue());
Object value = updateClause.getValue();
Assert.assertNotNull(clause.getValue()); Assert.assertNotNull(clause.getClass()); Assert.assertNotNull(clause.toString());
Object value = updateClause.getValue();