About literal

1-10 of 42Refresh
Manual
585

Literals in JPQL and Criteria Queries

Literals in JPQL, as in Java, represent constant values. JPQL supports various types of literals including NULL, boolean literals (TRUE and FALSE), numeric literals (e.g. 100), string literals (e.g. 'abc'), enum literals (e.g. mypackage.MyEnum.MY_VALUE) and entity type literals (e.g. Country). JPQL
JPA Doc
116

literal(value)

Method javax.persistence.criteria.CriteriaBuilder Expression literal(   T value ) Create an expression for a literal. Parameters: value - value represented by the expression Returns: expression literal Throws: IllegalArgumentException - if value is null Since: JPA 2.0
Manual
107

Query Parameters in JPA

for more details. Parameters vs. Literals Following is a third version of the same method, this time ... for the queried name, the new method embeds the name as a String literal. There are a few drawbacks to using literals rather than parameters in queries. First of all, the query is not reusable. Different
Manual
96

JPA Query Expressions (JPQL / Criteria)

/ Criteria Variables JPQL / Criteria Parameters JPQL / Criteria Literals Every query expression consists ... expressions are provided as follows: Literals and Dates (literal, nullLiteral, currentDate, ...). Paths
Manual
64

Strings in JPQL and Criteria Queries

String values may appear in JPQL queries in various forms: as string literals - e.g. 'abc', ''. as ... literal). For example: c.name LIKE '_r%' is TRUE for 'Brazil' and FALSE for 'Denmark' c.name LIKE ... "); Expression l3 = cb.locate(path, param, cb.literal(2)); Expression l4 = cb.locate
Manual
39

Numbers in JPQL and Criteria Queries

Numeric values may appear in JPQL queries in many forms: as numeric literals - e.g. 123, -12.5. as parameters - when numeric values are assigned as arguments. as path expressions - in navigation ... (cb.literal(100)); // SQRT(expression) As shown above, a number can always be converted to a numeric expression by using the literal method.
Manual
39

Paths and Types in JPQL and Criteria API

. The Country literal represents the Country entity class. The TYPE operator returns the actual type ... is not Country. Predicate p = cb.notEqual(e.type(), cb.literal(Country.class)); In ... a root or a join) and the entity type Country (a criteria literal).
Manual
32

Comparison in JPQL and Criteria API

); // BETWEEN Predicate b1 = cb.between(name, nameParam, cb.literal("Y")); Predicate b2 = cb.between(name, "X", "Y"); Predicate b3 = cb.between(area, areaParam, cb.literal(2000000
Manual
32

Date and Time in JPQL and Criteria Queries

Date and time expressions may appear in JPQL queries: as date and time literals - e.g. {d '2011-12-31'}, {t '23:59:59'}. as parameters - when date and time values are assigned as arguments. as path ... (); // both Unlike constant date literals which are built once on the client side, the current date and time
Manual
32

JPA Criteria API Queries

expressions are provided in the following page sections: Literals and Dates (literal, nullLiteral