Home » Search

About literal

1-10 of 42Refresh
Manual
443

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
87

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
79

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, the query is not reusable. Different literal
Manual
69

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
51

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
31

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 ... ); // -expression Expression sqrt = cb.sqrt(cb.literal(100)); // SQRT(expression) As shown above, a number can always be converted to a numeric expression by using the literal method.
Manual
31

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
25

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
25

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
25

JPA Criteria API Queries

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