get required field check java expression.

@param order field order
@param field java field
@return full java expression
191516
public static String getRequiredCheck(int order, Field field) {
        String fieldName = getFieldName(order);
        String code = "if (" + fieldName + "== null) {\n";
        code += "throw new UninitializedMessageException(CodedConstant.asList(\"" + field.getName() + "\"))"
                + ClassCode.JAVA_LINE_BREAK;
        code += "}\n";

        return code;
    }
1160070
function parseField(field, fieldName, model) {
		// parse & check attributes and include
		parseIncludes(field, fieldName, model.name, model);

		// parse & check order
		parseOrders(field, fieldName, model);
	}
1268991
public function orderBy($field, $order)
    {
        if (!in_array($field, $this->getAvailableFields())) {
            throw new \InvalidArgumentException(sprintf('Field "%s" not supported, prefer: %s', $field, implode(', ', $this->getAvailableFields())));
        }

        if (!in_array($order, array('ASC', 'DESC'))) {
            throw new \InvalidArgumentException(sprintf('Order "%s" not supported, prefer: ASC or DESC', $order));
        }

        $this->sort = array($field, $order);

        return $this;
    }
1293622
public FieldDescriptorDef getField(String name)
    {
        FieldDescriptorDef fieldDef = null;

        for (Iterator it = _fields.iterator(); it.hasNext(); )
        {
            fieldDef = (FieldDescriptorDef)it.next();
            if (fieldDef.getName().equals(name))
            {
                return fieldDef;
            }
        }
        return null;
    }
1069625
def lookup_field_orderable(self, field):
        
        try:
            self.model._meta.get_field_by_name(field)
            return True
        except Exception:
            # that field doesn't exist, so not sortable
            return False
630453
protected final String getValidJPAColumnName(Class<?> entity, Field f)
    {

        String name = null;

        if (f.isAnnotationPresent(Column.class))
        {
            Column c = f.getAnnotation(Column.class);
            if (!c.name().isEmpty())
            {
                name = c.name();
            }
            else
            {
                name = f.getName();
            }
        }
        else if (f.isAnnotationPresent(Basic.class))
        {
            name = f.getName();
        }

        if (f.isAnnotationPresent(Temporal.class))
        {
            if (!f.getType().equals(Date.class))
            {
                log.error("@Temporal must map to java.util.Date for @Entity(" + entity.getName() + "." + f.getName()
                        + ")");
                return name;
            }
            if (null == name)
            {
                name = f.getName();
            }
        }
        return name;
    }
950223
function checkIndexFieldsMatch(indexFields, sortOrder, fields) {
  if (sortOrder) {
    // array has to be a strict subarray of index array. furthermore,
    // the sortOrder fields need to all be represented in the index
    var sortMatches = utils.oneArrayIsStrictSubArrayOfOther(sortOrder, indexFields);
    var selectorMatches = utils.oneArrayIsSubArrayOfOther(fields, indexFields);

    return sortMatches && selectorMatches;
  }

  // all of the user's specified fields still need to be
  // on the left side of the index array, although the order
  // doesn't matter
  return utils.oneSetIsSubArrayOfOther(fields, indexFields);
}
420444
private boolean isRequired(Field field) {
        return field.getAnnotation(Require.class) != null
                // Use the field's declaring class for RequireAll; may be a super class
                || (field.getDeclaringClass().getAnnotation(RequireAll.class) != null
                && field.getAnnotation(NotRequired.class) == null);
    }
685521
public void buildOrderByClause(StringBuilder builder, String field, Object orderType, boolean useToken)
    {
        builder.append(SPACE_STRING);
        builder.append(SORT_CLAUSE);
        builder = ensureCase(builder, field, useToken);
        builder.append(SPACE_STRING);
        builder.append(orderType);
    }
692951
@SuppressWarnings("unchecked")
	public <T> T getOne(String field) {
		return (T) get(field).get(field);
	}
871967
public static <A extends Annotation> A getAnnotation(Field field, Class<A> annotationType) {
        if (field == null || annotationType == null) {
            return null;
        }

        return field.getAnnotation(annotationType);
    }
1215132
public static String getJsonFieldName(Field field) {
        String name = field.getName();
        return Formatter.toCamelCase(name);
    }
765418
public function order($field, $order = '')
    {
        if (is_array($field)) {
            $this->options['sort'] = $field;
        } else {
            $this->options['sort'][$field] = 'asc' == strtolower($order) ? 1 : -1;
        }
        return $this;
    }
188331
public int getFieldSeq(String fieldName)
    {
        for (int i = 0; i < this.getFieldCount(); i++)
        {
            if (fieldName.equals(this.getField(i).getFieldName()))
                return i;
        }
        return -1;
    }
764642
public OptionalSyntax orderBy(Path<?>... path) {
		String fieldList = "";
		boolean firstExpression = true;
		for (Path<?> exp : path) {
			if (firstExpression) {
				fieldList = fieldList.concat(exp.toString());
				firstExpression = false;
			} else {
				fieldList = fieldList.concat(", ").concat(exp.toString());
			}

			LOG.debug("expression: " + exp);
		}
		QueryMessage mess = getMessage();
		mess.setOrderByClause(fieldList);
		return new OptionalSyntax(mess);
	}
1214433
public function sortBy($field, $order = 'ASC')
    {
        //argument test
        Argument::i()
            //Argument 1 must be a string
            ->test(1, 'string')
            //Argument 2 must be a string
            ->test(2, 'string');
        
        $this->sortBy[] = $field . ' ' . $order;
        
        return $this;
    }
570425
public static String getRetRequiredCheck(String express, Field field) {
        String code = "if (CodedConstant.isNull(" + express + ")) {\n";
        code += "throw new UninitializedMessageException(CodedConstant.asList(\"" + field.getName() + "\"));\n";
        code += "}\n";

        return code;
    }