ObjectDB Database Search

1-50 of 144 results

JPA Query API

, which was the only interface available for representing queries in JPA 1, and the new TypedQuery interface that was introduced in JPA 2. The TypedQuery interface extends the Query interface. In JPA 2 the Query interface ... . When a more specific result type is expected queries should usually use the TypedQuery interface. It is easier to run

Running JPA Queries

other case. Similarly, the TypedQuery interface defines the following methods: TypedQuery .getSingleResult - for use when exactly one result object is expected. TypedQuery .getResultList ... objects in return: TypedQuery query = em. createQuery ("SELECT c FROM Country c", Country.class); List

Query Parameters in JPA

getCountryByName( EntityManager em, String name) { TypedQuery query = em. createQuery ( "SELECT c FROM ... method supports method chaining (by returning the same TypedQuery instance on which it was invoked ... ( EntityManager em, String name) { TypedQuery query = em. createQuery ( "SELECT c FROM Country c

JPA Criteria API Queries

expression. CriteriaQuery TypedQuery TypedQuery TypedQuery query = em. createQuery (q); List results ... queries, since the equivalent JPQL query could simply be executed as follows: TypedQuery query ... = query. getResultList (); Because eventually both types of queries are represented by a TypedQuery

InterfaceRef jakarta.persistence.TypedQuery

JPA Interface TypedQuery Type Parameters: - query result type Super Interfaces: Query Interface ... - JPA Queries (JPQL / Criteria) explains how to use TypedQuery . Public Methods int executeUpdate ... indicating whether parameter has been bound Inherited from: Query Since: JPA 2.0 TypedQuery

TypedQuery implementation problems

Hi everyone, I'm having problems. I have implemented TypedQuery in a module of my web system and everything works perfectly. but when making another module and implementing TypedQuery ... ; TypedQuery query = em.createQuery( "select new com.javatmp.module.accounting.entity.Account(" + "acct

SELECT clause (JPQL / Criteria API)

, the following query returns Country objects that become managed by the EntityManager em : TypedQuery query ... of the above query are received as a list of String values: TypedQuery query = em. createQuery ( "SELECT ... this query and processing the results: TypedQuery query = em. createQuery ( "SELECT c.name, c.capital

JPA Queries

Queries are represented in JPA by the Query and TypedQuery interfaces: The JPA Query API ... these interfaces to build and run JPQL queries. The TypedQuery interface (or alternatively the older Query ... a TypedQuery or a Query instance. Building a dynamic query using the criteria API is managed by the 

TypedQuery.setCacheRetrieveMode(cacheRetrieveMode) - JPA Method

JPA Method in jakarta.persistence. TypedQuery TypedQuery setCacheRetrieveMode (    CacheRetrieveMode  cacheRetrieveMode ) Set the cache retrieval mode that is in effect during query execution. This cache retrieval mode overrides the cache retrieve mode in use by the entity manager

TypedQuery.setCacheStoreMode(cacheStoreMode) - JPA Method

JPA Method in jakarta.persistence. TypedQuery TypedQuery setCacheStoreMode (    CacheStoreMode  cacheStoreMode ) Set the cache storage mode that is in effect during query execution. This cache storage mode overrides the cache storage mode in use by the entity manager. Parameters

TypedQuery.setTimeout(timeout) - JPA Method

JPA Method in jakarta.persistence. TypedQuery TypedQuery setTimeout (   Integer timeout ) Set the query timeout, in milliseconds. This is a hint, and is an alternative to plain jakarta.persistence.query.timeout . Parameters: timeout - the timeout, in milliseconds, or null to indicate no timeout Return: the same query instance Since: JPA 3.2

TypedQuery.setFirstResult(startPosition) - JPA Method

JPA Method in jakarta.persistence. TypedQuery TypedQuery setFirstResult (   int startPosition ) Set the position of the first result to retrieve. Parameters: startPosition - position of the first result, numbered from 0 Return: the same query instance Throws: IllegalArgumentException - if the argument is negative Since: JPA 2.0

TypedQuery.setMaxResults(maxResult) - JPA Method

JPA Method in jakarta.persistence. TypedQuery TypedQuery setMaxResults (   int maxResult ) Set the maximum number of results to retrieve. Parameters: maxResult - maximum number of results to retrieve Return: the same query instance Throws: IllegalArgumentException - if the argument is negative Since: JPA 2.0

TypedQuery.setParameter(param,value,temporalType) - JPA Method

JPA Method in jakarta.persistence. TypedQuery TypedQuery setParameter (    Parameter  param,    Date value,     TemporalType  temporalType ) Bind an instance of java.util.Date to a Parameter object. Parameters: param - parameter object value

TypedQuery.setParameter(name,value) - JPA Method

JPA Method in jakarta.persistence. TypedQuery TypedQuery setParameter (   String name,    Object value ) Bind an argument value to a named parameter. Parameters: name - parameter name value - parameter value Return: the same query instance Throws

TypedQuery.setParameter(param,value,temporalType) - JPA Method

JPA Method in jakarta.persistence. TypedQuery TypedQuery setParameter (    Parameter  param,    Calendar value,     TemporalType  temporalType ) Bind an instance of java.util.Calendar to a Parameter object. Parameters: param - parameter object

TypedQuery.setParameter(param,value) - JPA Method

JPA Method in jakarta.persistence. TypedQuery TypedQuery setParameter (    Parameter  param,    T value ) Bind the value of a Parameter object. Parameters: param - parameter object value - parameter value Return: the same query instance Throws

TypedQuery.setHint(hintName,value) - JPA Method

JPA Method in jakarta.persistence. TypedQuery TypedQuery setHint (   String hintName,    Object value ) Set a query property or hint. The hints elements may be used to specify query properties and hints. Properties defined by this specification must be observed by

TypedQuery.setParameter(position,value,temporalType) - JPA Method

JPA Method in jakarta.persistence. TypedQuery TypedQuery setParameter (   int position,    Calendar value,     TemporalType  temporalType ) Bind an instance of java.util.Calendar to a positional parameter. Parameters: position - position value

TypedQuery.setParameter(position,value,temporalType) - JPA Method

JPA Method in jakarta.persistence. TypedQuery TypedQuery setParameter (   int position,    Date value,     TemporalType  temporalType ) Bind an instance of java.util.Date to a positional parameter. Parameters: position - position value

TypedQuery.setParameter(position,value) - JPA Method

JPA Method in jakarta.persistence. TypedQuery TypedQuery setParameter (   int position,    Object value ) Bind an argument value to a positional parameter. Parameters: position - position value - parameter value Return: the same query instance Throws

TypedQuery.setParameter(name,value,temporalType) - JPA Method

JPA Method in jakarta.persistence. TypedQuery TypedQuery setParameter (   String name,    Date value,     TemporalType  temporalType ) Bind an instance of java.util.Date to a named parameter. Parameters: name - parameter name value - parameter

TypedQuery.setParameter(name,value,temporalType) - JPA Method

JPA Method in jakarta.persistence. TypedQuery TypedQuery setParameter (   String name,    Calendar value,     TemporalType  temporalType ) Bind an instance of java.util.Calendar to a named parameter. Parameters: name - parameter name value

TypedQuery.setLockMode(lockMode) - JPA Method

JPA Method in jakarta.persistence. TypedQuery TypedQuery setLockMode (    LockModeType  lockMode ) Set the lock mode type to be used for the query execution. Parameters: lockMode - lock mode Return: the same query instance Throws: IllegalStateException - if the query is found not

TypedQuery.setFlushMode(flushMode) - JPA Method

JPA Method in jakarta.persistence. TypedQuery TypedQuery setFlushMode (    FlushModeType  flushMode ) Set the flush mode type to be used for the query execution. The flush mode type applies to the query regardless of the flush mode type in use for the entity manager. Parameters

TypedQuery.getSingleResult() - JPA Method

JPA Method in jakarta.persistence. TypedQuery X getSingleResult () Execute a SELECT query that returns a single result. Return: the result, of type {@link X} Throws: NoResultException - if there is no result NonUniqueResultException - if more than one result IllegalStateException - if called

TypedQuery.getResultList() - JPA Method

JPA Method in jakarta.persistence. TypedQuery List getResultList () Execute a SELECT query and return the query results as a typed List. Return: a list of the results, each of type {@link X} , or an empty list if there are no results Throws: IllegalStateException - if called for a Jakarta

TypedQuery.getResultStream() - JPA Method

JPA Method in jakarta.persistence. TypedQuery Stream getResultStream () Execute a SELECT query and return the query result as a typed Stream . By default, this method delegates to List, however, persistence provider may choose to override this method to provide additional capabilities. Return

TypedQuery.getSingleResultOrNull() - JPA Method

JPA Method in jakarta.persistence. TypedQuery X getSingleResultOrNull () Execute a SELECT query that returns a single untyped result. Return: the result, of type {@link X} , or null if there is no result Throws: NonUniqueResultException - if more than one result IllegalStateException - if called

JPA Named Queries

at Runtime Named queries are represented at runtime by the same Query and TypedQuery interfaces ... receives a query name and a result type and returns a TypedQuery instance: TypedQuery query = em

Setting and Tuning of JPA Queries

The  Query and  TypedQuery interfaces define various setting and tuning methods that may affect query execution if invoked before a query is run using getResultList or getSingleResult ... in Query and TypedQuery support method chaining (by returning the query object

FROM clause (JPQL / Criteria API)

iteration: TypedQuery query =     em. createQuery ("SELECT c FROM Country c", Country

Online Backup

; TypedQuery backupQuery =     em.createQuery("objectdb backup", Thread.class);  

InterfaceRef jakarta.persistence.EntityManager

LockOption s. See Also: Query TypedQuery CriteriaQuery PersistenceContext StoredProcedureQuery ... and of any instance of Query , TypedQuery , or StoredProcedureQuery obtained from it throws ... See Also: NamedQuery NamedNativeQuery Since: JPA 1.0 TypedQuery createNamedQuery (String name

Step 3: Define an EJB Session Bean

.persistence.PersistenceContext; import javax.persistence. TypedQuery ; @Stateless public class GuestDao ... getAllGuests() { TypedQuery query = em.createQuery( "SELECT g FROM Guest g ORDER BY g.id", Guest.class

Step 3: Define a Spring DAO Component

.persistence. TypedQuery ; import org.springframework.stereotype.Component; import org.springframework ... () { TypedQuery query = em.createQuery( "SELECT g FROM Guest g ORDER BY g.id", Guest.class); return

Step 3: Define a Spring DAO Component

javax.persistence. TypedQuery ; import org.springframework.stereotype.Component; import org ... getAllGuests() { TypedQuery query = em.createQuery( "SELECT g FROM Guest g ORDER BY g.id", Guest.class); return

Step 3: Define an EJB Session Bean

.EntityManager; import javax.persistence.PersistenceContext; import javax.persistence. TypedQuery ... ); } // Retrieves all the guests: public List getAllGuests() { TypedQuery query = em.createQuery( "SELECT g FROM

EntityManager.createQuery(criteriaQuery) - JPA Method

JPA Method in jakarta.persistence.EntityManager TypedQuery createQuery (    CriteriaQuery  criteriaQuery ) Create an instance of TypedQuery for executing a criteria query. Parameters: criteriaQuery - a criteria query object Return: the new query instance Throws

EntityManager.createQuery(selectQuery) - JPA Method

JPA Method in jakarta.persistence.EntityManager TypedQuery createQuery (    CriteriaSelect  selectQuery ) Create an instance of TypedQuery for executing a criteria query, which may be a union or intersection of top-level queries. Parameters: selectQuery - a criteria query object

EnumRef jakarta.persistence.FlushModeType

within a transaction, if AUTO is set on the Query or TypedQuery object, or if the flush mode setting ... for the Query or TypedQuery object, the persistence provider is responsible for ensuring that all updates

EntityManager.createQuery(reference) - JPA Method

JPA Method in jakarta.persistence.EntityManager TypedQuery createQuery (    TypedQueryReference  reference ) Create an instance of TypedQuery for executing a named query written in the Jakarta Persistence query language or in native SQL. Parameters: reference - a reference

EntityManager.createQuery(qlString,resultClass) - JPA Method

JPA Method in jakarta.persistence.EntityManager TypedQuery createQuery (   String qlString,    Class  resultClass ) Create an instance of TypedQuery for executing a Jakarta Persistence query language statement. The select list of the query must contain

EntityManager.createNamedQuery(name,resultClass) - JPA Method

JPA Method in jakarta.persistence.EntityManager TypedQuery createNamedQuery (   String name,    Class  resultClass ) Create an instance of TypedQuery for executing a Jakarta Persistence query language named query. The select list of the query must contain

EnumRef jakarta.persistence.PessimisticLockScope

may be passed as an argument to the methods of the EntityManager , Query , and TypedQuery interfaces

EnumRef jakarta.persistence.LockModeType

locks ( lock() , find() , or refresh() ), or to Query.setLockMode or TypedQuery .setLockMode

EntityManagerFactory.addNamedQuery(name,query) - JPA Method

is replaced. Parameters: name - name for the query query - a {@link Query} , {@link TypedQuery } , or {@link StoredProcedureQuery} Since: JPA 2.1

InterfaceRef jakarta.persistence.EntityManagerFactory

for the query query - a {@link Query} , {@link TypedQuery } , or {@link StoredProcedureQuery

ClassRef jakarta.persistence.NonUniqueResultException

() TypedQuery .getSingleResult () Since: JPA 1.0 Public Constructors NonUniqueResultException () Constructs

InterfaceRef jakarta.persistence.Query

JPA Interface Query Interface used to control query execution. See Also: TypedQuery StoredProcedureQuery Parameter Since: JPA 1.0 Chapter 4 - JPA Queries (JPQL / Criteria) explains how to use Query . Public Methods int executeUpdate () Execute an update or delete statement. Return: the number