ObjectDB ObjectDB

Internal Website Search

11-20 of 200 resultsRefresh
78

Chapter 4 - JPA Queries (JPQL / Criteria)

(named) queries. It explains how to use the relevant interfaces, annotations, enums and methods ... The JPA Query Language (JPQL) can be considered as an object oriented version of SQL. Users ... well as how to use the JPA Criteria API, which provides an alternative way for building queries in JPA
78

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 '%' is always TRUE (for any c.name value). c.name NOT LIKE '%' is always FALSE (for any c.name value
76

JPA Annotations for JPQL Queries

The following annotations are used to define static named JPA queries: The JPA Named Queries section of the ObjectDB Manual explains and demonstrates how to use these annotations to define named JPQL queries.
50

getParameter(name, type)

Method javax.persistence.Query Parameter<T> getParameter( String name, Class<T> type ) Get the parameter object corresponding to the declared parameter of the given name and type. This method is required to be supported for criteria queries only. Parameters: name - parameter name type - type
50

setParameter(name, value)

Method javax.persistence.Query Query setParameter( String name, Object value ) Bind an argument to a named parameter. Parameters: name - parameter name value - parameter value Returns: the same query instance Throws: IllegalArgumentException - if the parameter name does not correspond
50

setParameter(name, value, temporalType)

Method javax.persistence.Query Query setParameter( String name, Calendar value, TemporalType ... name value - parameter value temporalType - temporal type Returns: the same query instance Throws: IllegalArgumentException - if the parameter name does not correspond to a parameter of the query or if the value argument is of incorrect type Since: JPA 1.0
50

setParameter(name, value, temporalType)

Method javax.persistence.Query Query setParameter( String name, Date value, TemporalType temporalType ) Bind an instance of java.util.Date to a named parameter. Parameters: name - parameter name ... : IllegalArgumentException - if the parameter name does not correspond to a parameter of the query or if the value argument is of incorrect type Since: JPA 1.0
49

getParameter(name)

Method javax.persistence.Query Parameter<?> getParameter( String name ) Get the parameter object corresponding to the declared parameter of the given name. This method is not required to be supported for native queries. Parameters: name - parameter name Returns: parameter object Throws
49

getParameterValue(name)

Method javax.persistence.Query Object getParameterValue( String name ) Return the value bound to the named parameter. Parameters: name - parameter name Returns: parameter value Throws: IllegalStateException - if the parameter has not been been bound IllegalArgumentException - if the parameter of the specified name does not exist Since: JPA 2.0
4

Query.name

Annotation Element javax.jdo.annotations.Query String name Name of the query (mandatory) Returns: the name of the query Since: JDO 2.1

Getting Started

ObjectDB is very easy to use. Follow the Getting Started Tutorial and the Quick Tour manual chapter and in minutes you may be able to write and run first Java programs against ObjectDB.

Prior knowledge or experience in database programming (SQL, JDBC, ORM, JPA, etc.) is not required, but some background in using the Java language is essential.

Need Help?

  1. Search ObjectDB website
  2. Read the FAQ
  3. Follow the Tutorials
  4. View or post in the forum
  5. Search or file an issue
  6. Contact support