Skip Headers

# Expression Method getField

Previous

Next

The `Expression` method `getField` returns an expression that represents a database field with the given name. Use this method to construct the selection criteria for a mapping. The argument is the fully qualified name of the required field. Because fields are not global to the current query, you must send this method to an expression that represents the table from which this field is derived. See also "Data Queries and Expressions" .

Example: Using Expression Method getParameter illustrates how to use the `Expression` method `getField`.

Using Expression Method getParameter

    ExpressionBuilder address = new ExpressionBuilder();
    Expression exp = address.getField("ADDRESS.EMP_ID").equal(
        address.getParameter("EMPLOYEE.EMP_ID")
    );
    exp = exp.and(address.getField("ADDRESS.TYPE").equal(null));