|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.jpa.JPAQuery
public class JPAQuery
Basic implementation of a JPA Query. Wraps an internal query.
| Field Summary | |
|---|---|
protected static org.datanucleus.util.Localiser |
LOCALISER
Localisation utility for output messages |
| Constructor Summary | |
|---|---|
JPAQuery(javax.persistence.EntityManager em,
org.datanucleus.store.query.Query query,
java.lang.String language)
Constructor for a query used by JPA. |
|
| Method Summary | |
|---|---|
int |
executeUpdate()
Method to execute a (UPDATE/DELETE) query returning the number of changed records. |
int |
getFirstResult()
The position of the first result the query object was set to retrieve. |
javax.persistence.FlushModeType |
getFlushMode()
The flush mode in effect for the query execution. |
java.util.Map |
getHints()
Get the hints and associated values that are in effect for the query instance. |
org.datanucleus.store.query.Query |
getInternalQuery()
Accessor for the internal query. |
java.lang.String |
getLanguage()
Accessor for the query language. |
int |
getMaxResults()
The maximum number of results the query object was set to retrieve. |
java.util.Map |
getNamedParameters()
Get the parameters names and associated values of the parameters that are bound for the query instance. |
java.util.List |
getPositionalParameters()
Get the values of the positional parameters that are bound for the query instance. |
java.util.List |
getResultList()
Method to execute a (SELECT) query statement returning multiple results. |
java.lang.Object |
getSingleResult()
Method to execute a SELECT statement returning a single result. |
java.util.Set<java.lang.String> |
getSupportedHints()
Get the names of the hints that are supported for query objects. |
javax.persistence.Query |
setFirstResult(int startPosition)
Method to set the results to start from a particular position. |
javax.persistence.Query |
setFlushMode(javax.persistence.FlushModeType mode)
Mutator for the flush mode. |
javax.persistence.Query |
setHint(java.lang.String hintName,
java.lang.Object value)
Method to add a vendor extension to the query. |
javax.persistence.Query |
setMaxResults(int max)
Method to set the max number of results to return. |
javax.persistence.Query |
setParameter(int position,
java.util.Calendar value,
javax.persistence.TemporalType temporalType)
Bind an instance of java.util.Calendar to a positional parameter. |
javax.persistence.Query |
setParameter(int position,
java.util.Date value,
javax.persistence.TemporalType temporalType)
Bind an instance of java.util.Date to a positional parameter. |
javax.persistence.Query |
setParameter(int position,
java.lang.Object value)
Bind an argument to a positional parameter. |
javax.persistence.Query |
setParameter(java.lang.String name,
java.util.Calendar value,
javax.persistence.TemporalType temporalType)
Bind an instance of java.util.Calendar to a named parameter. |
javax.persistence.Query |
setParameter(java.lang.String name,
java.util.Date value,
javax.persistence.TemporalType temporalType)
Bind an instance of java.util.Date to a named parameter. |
javax.persistence.Query |
setParameter(java.lang.String name,
java.lang.Object value)
Bind an argument to a named parameter. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final org.datanucleus.util.Localiser LOCALISER
| Constructor Detail |
|---|
public JPAQuery(javax.persistence.EntityManager em,
org.datanucleus.store.query.Query query,
java.lang.String language)
em - Entity Managerquery - Underlying querylanguage - Query language| Method Detail |
|---|
public int executeUpdate()
executeUpdate in interface javax.persistence.Querypublic java.util.List getResultList()
getResultList in interface javax.persistence.Querypublic java.lang.Object getSingleResult()
getSingleResult in interface javax.persistence.Querypublic javax.persistence.Query setFirstResult(int startPosition)
setFirstResult in interface javax.persistence.QuerystartPosition - position of first result numbered from 0
public javax.persistence.Query setMaxResults(int max)
setMaxResults in interface javax.persistence.Querymax - Number of results max
public int getMaxResults()
public int getFirstResult()
public javax.persistence.Query setFlushMode(javax.persistence.FlushModeType mode)
setFlushMode in interface javax.persistence.Querymode - Flush mode
public javax.persistence.FlushModeType getFlushMode()
public javax.persistence.Query setHint(java.lang.String hintName,
java.lang.Object value)
setHint in interface javax.persistence.QueryhintName - Name of the "hint"value - Value for the "hint"
java.lang.IllegalArgumentException - if the second argument is not valid for the implementationpublic java.util.Map getHints()
public java.util.Set<java.lang.String> getSupportedHints()
public javax.persistence.Query setParameter(java.lang.String name,
java.lang.Object value)
setParameter in interface javax.persistence.Queryname - the parameter namevalue - The value for the param
java.lang.IllegalArgumentException - if parameter name does not correspond to parameter in query string or argument is of incorrect type
public javax.persistence.Query setParameter(int position,
java.lang.Object value)
setParameter in interface javax.persistence.Queryposition - Parameter positionvalue - The value
java.lang.IllegalArgumentException - if position does not correspond to positional parameter of query or argument is of incorrect type
public javax.persistence.Query setParameter(java.lang.String name,
java.util.Date value,
javax.persistence.TemporalType temporalType)
setParameter in interface javax.persistence.Queryname - Name of the paramvalue - Value for the paramtemporalType - The temporal type
java.lang.IllegalArgumentException - if parameter name does not correspond to parameter in query string
public javax.persistence.Query setParameter(java.lang.String name,
java.util.Calendar value,
javax.persistence.TemporalType temporalType)
setParameter in interface javax.persistence.Queryname - name of the paramvalue - Value for the paramtemporalType - The temporal type
java.lang.IllegalArgumentException - if parameter name does not correspond to parameter in query string
public javax.persistence.Query setParameter(int position,
java.util.Date value,
javax.persistence.TemporalType temporalType)
setParameter in interface javax.persistence.Queryposition - Parameter positionvalue - Value for the paramtemporalType - Temporal Type
java.lang.IllegalArgumentException - if position does not correspond to positional parameter of query
public javax.persistence.Query setParameter(int position,
java.util.Calendar value,
javax.persistence.TemporalType temporalType)
setParameter in interface javax.persistence.Queryposition - Parameter positionvalue - Value for the paramtemporalType - Temporal type
java.lang.IllegalArgumentException - if position does not correspond to positional parameter of querypublic java.util.Map getNamedParameters()
public java.util.List getPositionalParameters()
public org.datanucleus.store.query.Query getInternalQuery()
public java.lang.String getLanguage()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||