query-by method for field updatedBy
@param updatedBy the specified attribute
@return an Iterable of Di18ns for the specified updatedBy
482610
public Iterable<Di18n> queryByUpdatedBy(java.lang.String updatedBy) {
    return queryByField(null, Di18nMapper.Field.UPDATEDBY.getFieldName(), updatedBy);
  }
363123
public QueryBuilder<T, ID> groupBy(String columnName) {
		FieldType fieldType = verifyColumnName(columnName);
		if (fieldType.isForeignCollection()) {
			throw new IllegalArgumentException("Can't groupBy foreign collection field: " + columnName);
		}
		addGroupBy(ColumnNameOrRawSql.withColumnName(columnName));
		return this;
	}
1160065
static <S> String translate(CriteriaQuery criteriaQuery)
    {
        QueryBuilder builder = new CriteriaQueryTranslator.QueryBuilder();

        // validate if criteria query is valid

        /**
         * select, from clause is mandatory
         * 
         * multiple from clause not support where clause is optional
         * 
         */

        Selection<S> select = criteriaQuery.getSelection();

        if (select != null)
        {
            builder.appendSelectClause();

        }

        if (select.getClass().isAssignableFrom(DefaultCompoundSelection.class)
                && ((CompoundSelection) select).isCompoundSelection())
        {
            List<Selection<?>> selections = ((CompoundSelection) select).getCompoundSelectionItems();
            builder.appendMultiSelect(selections);
        }
        else if (select instanceof AggregateExpression)
        {
            builder.appendAggregate(((AggregateExpression) select).getAggregation());
        }
        else
        {
            String alias = select.getAlias();

            if (!StringUtils.isEmpty(alias))
            {
                builder.appendAlias(alias);
            }

            Attribute attribute = ((DefaultPath) select).getAttribute();

            if (attribute != null)
            {
                builder.appendAttribute(attribute);
            }
        }
        Class<? extends S> clazzType = select.getJavaType();

        Set<Root<?>> roots = criteriaQuery.getRoots();

        Root<?> from = roots.iterator().next();

        Class entityClazz = from.getJavaType();

        builder.appendFromClause();

        // select.alias(paramString)
        builder.appendFrom(entityClazz);
        builder.appendAlias(from.getAlias() != null ? from.getAlias() : select.getAlias());
        Predicate where = criteriaQuery.getRestriction(); // this could be null.
        if (where != null)
        {
            builder.appendWhereClause();
            List<Expression<Boolean>> expressions = where.getExpressions();
            for (Expression expr : expressions)
            {
                builder.appendWhere(expr, from.getAlias());
            }

        }

        List<Order> orderings = criteriaQuery.getOrderList();

        if (orderings != null && !orderings.isEmpty())
        {
            builder.appendOrderClause(where == null);
            String alias = from.getAlias() != null ? from.getAlias() : select.getAlias();
            builder.appendMultiOrdering(orderings, alias);
        }
        return builder.getQuery();

        // check that roots has to be one. multiple clause not yet supported

    }
311329
public Versioned<E> getVersionedById(int id) {
        Versioned<VListNode<E>> listNode = getListNode(id);
        if(listNode == null)
            throw new IndexOutOfBoundsException();
        return new Versioned<E>(listNode.getValue().getValue(), listNode.getVersion());
    }
384488
@Override
    public DBObject getUpdateClause() {
        if (clear) {
            // If clear() was called, updates will either be an empty Map or added items with prefix-less keys
            return new BasicDBObject($set.name(), new BasicDBObject(getNameFromPrefix(), updates));
        } else if (operation == null) {
            return new BasicDBObject();     // If there are no updates, return an empty DBObject
        } else {
            return new BasicDBObject(operation.name(), updates);
        }
    }
906891
public static <M extends Model> Updater<M> withUpdater(String sql) {
        return withUpdater(DataSourceManager.getDefaultDataSourceName(), sql);
    }
1166795
public Iterable<Di18n> queryByKey(java.lang.String key) {
    return queryByField(null, Di18nMapper.Field.KEY.getFieldName(), key);
  }
1315650
@JsonProperty("aliases")
    @JsonInclude(Include.NON_EMPTY)
    public Map<String, List<TermImpl>> getAliasUpdates() {
    	
    	Map<String, List<TermImpl>> updatedValues = new HashMap<>();
    	for(Map.Entry<String,AliasesWithUpdate> entry : newAliases.entrySet()) {
    		AliasesWithUpdate update = entry.getValue();
    		if (!update.write) {
    			continue;
    		}
    		List<TermImpl> convertedAliases = new ArrayList<>();
    		for(MonolingualTextValue alias : update.aliases) {
    			convertedAliases.add(monolingualToJackson(alias));
    		}
    		updatedValues.put(entry.getKey(), convertedAliases);
    	}
    	return updatedValues;
    }
14853
public static QueryParameters updateTypes(QueryParameters original, QueryParameters source) {
        QueryParameters updatedParams = new QueryParameters(original);
        Integer position = null;
        String originalKey = null;

        if (source != null) {
            for (String sourceKey : source.keySet()) {
                position = source.getFirstPosition(sourceKey);

                if (position != null) {
                    originalKey = original.getNameByPosition(position);
                    if (updatedParams.containsKey(originalKey) == true) {
                        updatedParams.updateType(originalKey, source.getType(sourceKey));
                    }
                }
            }
        }

        return updatedParams;
    }
1244221
public static List<Pair<String, TypeName>> orderContentValues(final SQLiteModelMethod method, final List<Pair<String, TypeName>> updateableParams) {
		final List<Pair<String, TypeName>> result = new ArrayList<Pair<String, TypeName>>();

		JQLChecker checker = JQLChecker.getInstance();
		final One<Boolean> inserMode = new One<Boolean>(false);

		checker.replace(method, method.jql, new JQLReplacerListenerImpl(method) {

			// used in update
			@Override
			public String onColumnNameToUpdate(String columnName) {
				String column = currentEntity.findPropertyByName(columnName).columnName;

				for (Pair<String, TypeName> item : updateableParams) {
					String paramNameInQuery = method.findParameterAliasByName(item.value0);
					if (paramNameInQuery.equalsIgnoreCase(columnName)) {
						result.add(item);
						break;
					}
				}

				return column;
			}

			// used in insert
			@Override
			public void onColumnNameSetBegin(Column_name_setContext ctx) {
				inserMode.value0 = true;
			}

			@Override
			public void onColumnNameSetEnd(Column_name_setContext ctx) {
				inserMode.value0 = false;
			}

			@Override
			public String onColumnName(String columnName) {
				if (!inserMode.value0)
					return columnName;
				String column = currentEntity.findPropertyByName(columnName).columnName;

				for (Pair<String, TypeName> item : updateableParams) {
					String paramNameInQuery = method.findParameterAliasByName(item.value0);
					if (paramNameInQuery.equalsIgnoreCase(columnName)) {
						result.add(item);
						break;
					}
				}

				return column;
			}

		});

		return result;
	}
155562
private void generateJavaDoc(final SQLiteModelMethod method, Builder methodBuilder, boolean updateMode) {
		List<Pair<String, TypeName>> methodParams = method.getParameters();

		final List<SQLProperty> updatedProperties = new ArrayList<>();
		final List<Pair<String, TypeName>> methodParamsUsedAsParameter = new ArrayList<>();

		// new
		String sqlModify = JQLChecker.getInstance().replace(method, method.jql, new JQLReplacerListenerImpl(method) {

			@Override
			public String onColumnNameToUpdate(String columnName) {
				SQLProperty tempProperty = currentEntity.get(columnName);
				AssertKripton.assertTrueOrUnknownPropertyInJQLException(tempProperty != null, method, columnName);

				updatedProperties.add(tempProperty);

				return tempProperty.columnName;
			}

			@Override
			public String onColumnName(String columnName) {
				SQLProperty tempProperty = currentEntity.get(columnName);
				AssertKripton.assertTrueOrUnknownPropertyInJQLException(tempProperty != null, method, columnName);

				return tempProperty.columnName;
			}

			@Override
			public String onBindParameter(String bindParameterName, boolean inStatement) {
				String resolvedParamName = method.findParameterNameByAlias(bindParameterName);
				AssertKripton.assertTrueOrUnknownParamInJQLException(resolvedParamName != null, method, bindParameterName);

				methodParamsUsedAsParameter.add(new Pair<>(resolvedParamName, method.findParameterType(resolvedParamName)));

				return SqlAnalyzer.PARAM_PREFIX + bindParameterName + SqlAnalyzer.PARAM_SUFFIX;
			}

		});

		if (updateMode) {
			methodBuilder.addJavadoc("<h2>SQL update</h2>\n");
			methodBuilder.addJavadoc("<pre>$L</pre>\n", sqlModify);
			methodBuilder.addJavadoc("\n");

			// list of updated fields
			methodBuilder.addJavadoc("<h2>Updated columns:</h2>\n");
			methodBuilder.addJavadoc("<ul>\n");
			for (SQLProperty property : updatedProperties) {
				methodBuilder.addJavadoc("\t<li>$L</li>\n", property.columnName);
			}
			methodBuilder.addJavadoc("</ul>");
			methodBuilder.addJavadoc("\n\n");

		} else {
			methodBuilder.addJavadoc("<h2>SQL delete</h2>\n");
			methodBuilder.addJavadoc("<pre>$L</pre>\n", sqlModify);
			methodBuilder.addJavadoc("\n\n");
		}

		// list of where parameter
		methodBuilder.addJavadoc("<h2>Parameters:</h2>\n");
		methodBuilder.addJavadoc("<dl>\n");
		for (Pair<String, TypeName> property : methodParamsUsedAsParameter) {
			String rawName = method.findParameterNameByAlias(property.value0);
			methodBuilder.addJavadoc("\t<dt>$L</dt>", SqlAnalyzer.PARAM_PREFIX + property.value0 + SqlAnalyzer.PARAM_SUFFIX);
			methodBuilder.addJavadoc("<dd>is mapped to method's parameter <strong>$L</strong></dd>\n", rawName);
		}
		methodBuilder.addJavadoc("</dl>");
		methodBuilder.addJavadoc("\n\n");

		if (method.hasDynamicWhereConditions()) {
			methodBuilder.addJavadoc("<dl>\n");
			methodBuilder.addJavadoc("<dt>$L</dt><dd>is part of where conditions resolved at runtime. In above SQL it is displayed as #{$L}</dd>", method.dynamicWhereParameterName,
					JQLDynamicStatementType.DYNAMIC_WHERE);
			methodBuilder.addJavadoc("\n</dl>");
			methodBuilder.addJavadoc("\n\n");
		}

		// dynamic conditions
		if (method.hasDynamicWhereConditions()) {
			methodBuilder.addJavadoc("<h2>Method's parameters and associated dynamic parts:</h2>\n");
			methodBuilder.addJavadoc("<dl>\n");

			if (method.hasDynamicWhereConditions()) {
				methodBuilder.addJavadoc("<dt>$L</dt><dd>is part of where conditions resolved at runtime. In above SQL it is displayed as #{$L}</dd>", method.dynamicWhereParameterName,
						JQLDynamicStatementType.DYNAMIC_WHERE);
			}

			methodBuilder.addJavadoc("</dl>");
			methodBuilder.addJavadoc("\n\n");
		}

		// method parameters
		if (methodParams.size() > 0) {
			for (Pair<String, TypeName> param : methodParams) {
				String resolvedName = method.findParameterAliasByName(param.value0);
				methodBuilder.addJavadoc("@param $L", param.value0);
				if (method.isThisDynamicWhereConditionsName(param.value0)) {
					methodBuilder.addJavadoc("\n\tis used as dynamic where conditions\n");
				} else {
					methodBuilder.addJavadoc("\n\tis used as for parameter <strong>$L</strong>\n", resolvedName);
				}
			}
		}

		// if true, field must be associate to ben attributes
		TypeName returnType = method.getReturnClass();
		// define return value
		if (returnType == TypeName.VOID) {

		} else {
			methodBuilder.addJavadoc("\n");
			if (isIn(returnType, Boolean.TYPE, Boolean.class)) {
				if (updateMode) {
					methodBuilder.addJavadoc("@return <code>true</code> if record is updated, <code>false</code> otherwise");
				} else {
					methodBuilder.addJavadoc("@return <code>true</code> if record is deleted, <code>false</code> otherwise");
				}
				methodBuilder.addCode("return result!=0;\n");
			} else if (isIn(returnType, Long.TYPE, Long.class, Integer.TYPE, Integer.class, Short.TYPE, Short.class)) {
				if (updateMode) {
					methodBuilder.addJavadoc("@return number of updated records");
				} else {
					methodBuilder.addJavadoc("@return number of deleted records");
				}

				// methodBuilder.addCode("return result;\n");
			} else {
				// more than one listener found
				throw (new InvalidMethodSignException(method, "invalid return type"));
			}
			methodBuilder.addJavadoc("\n");
		}

	}
1276473
@Override
	public Map<String, Object> getChildren(Boolean includeInheritedFields)
	{
		Map<String, Object> fields = new HashMap<String, Object>();
		if (includeInheritedFields)
		{
			fields.putAll(super.getChildren(includeInheritedFields));
		}
		fields.put("unicode", this.unicode);
		return fields;
	}
71898
public Iterable<DConnection> queryByUpdatedDate(java.util.Date updatedDate) {
    return queryByField(null, DConnectionMapper.Field.UPDATEDDATE.getFieldName(), updatedDate);
  }
1275668
public Iterable<DFactory> queryByUpdatedBy(java.lang.String updatedBy) {
    return queryByField(null, DFactoryMapper.Field.UPDATEDBY.getFieldName(), updatedBy);
  }
96632
def _get_update_fields(model, uniques, to_update):
    
    fields = {
        field.attname: field
        for field in model._meta.fields
    }

    if to_update is None:
        to_update = [
            field.attname for field in model._meta.fields
        ]

    to_update = [
        attname for attname in to_update
        if (attname not in uniques
            and not getattr(fields[attname], 'auto_now_add', False)
            and not fields[attname].auto_created)
    ]

    return to_update
978577
public DocumentT findOneAndUpdate(final Bson filter, final Bson update) {
    return proxy.findOneAndUpdate(filter, update);
  }
1120989
public QueryBuilder<T, ID> orderBy(String columnName, boolean ascending) {
		FieldType fieldType = verifyColumnName(columnName);
		if (fieldType.isForeignCollection()) {
			throw new IllegalArgumentException("Can't orderBy foreign collection field: " + columnName);
		}
		addOrderBy(new OrderBy(columnName, ascending));
		return this;
	}