About literal

manual

Literals in JPQL and Criteria Queries

Describes literals in JPQL, including null, false, true, numbers, strings, dates enums and types.... covers the following topics: The NULL literal Boolean Literals Numeric Literals ... Criteria Query Literals The NULL literal The NULL literal represents a null ...

 
api-jpa

literal(value)

Create an expression for a literal.(Method of javax.persistence.criteria.CriteriaBuilder)

 
manual

Query Parameters in JPA

Explains how to use parameters (named parameters and ordinal parameters) in JPA queries.... name the new method embeds the name as a String literal. There are a few drawbacks to using literals rather than parameters in ... First, the query is not reusable. Different literal values lead to different query strings and each query string requires ...

 
manual

JPA Query Expressions (JPQL / Criteria)

Describes JPA query (JPQL / Criteria API) expressions (literals, operators and functions).... follows: Literals and Dates  ( literal literal(value) CriteriaBuilder's method Create an expression for a ...

 
manual

Strings in JPQL and Criteria Queries

Explains string expressions in JPQL queries, including LIKE, LOCATE, LOWER, UPPER, TRIM, CONCAT and SUBSTRING.... operand is always the pattern (usually a parameter or literal). For example: c.name LIKE '_r%' is ... Reference Page... ( path, param, cb. literal literal(value) CriteriaBuilder's method Create an ...

 
forum_thread

Possible issue with timestamps

Hi, If I query doing something like: select c from CDI c where c.creationDate > {ts '2012-03-29 11:00:00} and c.creationDate < {ts '2012-03-29 12:00:00'} the test fails. Its ONLY for 12:00:00. When I started digging I found that if I queried 00:00:00 to 00:25:00 and then did 12:00:00 to 12:25:00 I got IDENTICAL results. For some reason 12:00:00 is being treated the same as 00:00:00. All other hours seem to be fine. #1 2012-03-29 05:07 Hi, If I query doing something like: select c from CDI c where c.creationDate > {ts '2012-03-29 11 ...

 
manual

Numbers in JPQL and Criteria Queries

Shows how numbers, arithmetic expressions and numeric functions and operators (MOD, ABS) can be used in JPQL queries.... See JavaDoc Reference Page... ( cb. literal literal(value) CriteriaBuilder's method Create an expression for a ...

 
api-jpa

nullLiteral(resultClass)

Create an expression for a null literal with the given type.(Method of javax.persistence.criteria.CriteriaBuilder)

 
manual

Date and Time in JPQL and Criteria Queries

Shows how date and time can be used in JPQL 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. ...

 
forum_thread

Using date in where clause

I am trying to build a SELECT query as follows. SELECT p FROM Persons p WHERE creationDate="07-25-2013" Here I have created Persons object as java.sql.Date attribute.   But in doing so I am getting following exception Operand type mismatch for operator '=' (error 757) (position 51) at com.objectdb.jpa.JpaQuery.getResultList(JpaQuery.java:695)   Can someone provide me that way to build a query with date in where clause. ... compare a date (the creationDate field) with a string literal ("07-25-2013"). Replace the string with a date literal or a parameter . ObjectDB Support ...