X
- is the generic type of the result objects of this query.public class TypedQueryMock<X> extends Object implements javax.persistence.TypedQuery<X>
TypedQuery
.Modifier and Type | Field and Description |
---|---|
private List<Object> |
parameterList |
private Map<String,Object> |
parameterMap |
private String |
query |
private Class<X> |
resultType |
Constructor and Description |
---|
TypedQueryMock(String query,
Class<X> resultType)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
executeUpdate() |
int |
getFirstResult() |
javax.persistence.FlushModeType |
getFlushMode() |
Map<String,Object> |
getHints() |
javax.persistence.LockModeType |
getLockMode() |
int |
getMaxResults() |
javax.persistence.Parameter<?> |
getParameter(int arg0) |
<T> javax.persistence.Parameter<T> |
getParameter(int arg0,
Class<T> arg1) |
javax.persistence.Parameter<?> |
getParameter(String arg0) |
<T> javax.persistence.Parameter<T> |
getParameter(String arg0,
Class<T> arg1) |
Set<javax.persistence.Parameter<?>> |
getParameters() |
Object |
getParameterValue(int index) |
<T> T |
getParameterValue(javax.persistence.Parameter<T> arg0) |
Object |
getParameterValue(String name) |
String |
getQuery() |
List<X> |
getResultList() |
Class<X> |
getResultType() |
X |
getSingleResult() |
boolean |
isBound(javax.persistence.Parameter<?> arg0) |
javax.persistence.TypedQuery<X> |
setFirstResult(int arg0) |
javax.persistence.TypedQuery<X> |
setFlushMode(javax.persistence.FlushModeType arg0) |
javax.persistence.TypedQuery<X> |
setHint(String arg0,
Object arg1) |
javax.persistence.TypedQuery<X> |
setLockMode(javax.persistence.LockModeType arg0) |
javax.persistence.TypedQuery<X> |
setMaxResults(int arg0) |
javax.persistence.TypedQuery<X> |
setParameter(int arg0,
Calendar arg1,
javax.persistence.TemporalType arg2) |
javax.persistence.TypedQuery<X> |
setParameter(int arg0,
Date arg1,
javax.persistence.TemporalType arg2) |
javax.persistence.TypedQuery<X> |
setParameter(int index,
Object parameter) |
javax.persistence.TypedQuery<X> |
setParameter(javax.persistence.Parameter<Calendar> arg0,
Calendar arg1,
javax.persistence.TemporalType arg2) |
javax.persistence.TypedQuery<X> |
setParameter(javax.persistence.Parameter<Date> arg0,
Date arg1,
javax.persistence.TemporalType arg2) |
<T> javax.persistence.TypedQuery<X> |
setParameter(javax.persistence.Parameter<T> arg0,
T arg1) |
javax.persistence.TypedQuery<X> |
setParameter(String arg0,
Calendar arg1,
javax.persistence.TemporalType arg2) |
javax.persistence.TypedQuery<X> |
setParameter(String arg0,
Date arg1,
javax.persistence.TemporalType arg2) |
javax.persistence.TypedQuery<X> |
setParameter(String name,
Object parameter) |
String |
toString() |
<T> T |
unwrap(Class<T> arg0) |
private final String query
public TypedQueryMock(String query, Class<X> resultType)
query
- - see getQuery()
.resultType
- - see getResultType()
.public String getQuery()
public int executeUpdate()
executeUpdate
in interface javax.persistence.Query
public int getFirstResult()
getFirstResult
in interface javax.persistence.Query
public javax.persistence.FlushModeType getFlushMode()
getFlushMode
in interface javax.persistence.Query
public Map<String,Object> getHints()
getHints
in interface javax.persistence.Query
public javax.persistence.LockModeType getLockMode()
getLockMode
in interface javax.persistence.Query
public int getMaxResults()
getMaxResults
in interface javax.persistence.Query
public javax.persistence.Parameter<?> getParameter(String arg0)
getParameter
in interface javax.persistence.Query
public javax.persistence.Parameter<?> getParameter(int arg0)
getParameter
in interface javax.persistence.Query
public <T> javax.persistence.Parameter<T> getParameter(String arg0, Class<T> arg1)
getParameter
in interface javax.persistence.Query
public <T> javax.persistence.Parameter<T> getParameter(int arg0, Class<T> arg1)
getParameter
in interface javax.persistence.Query
public <T> T getParameterValue(javax.persistence.Parameter<T> arg0)
getParameterValue
in interface javax.persistence.Query
public Object getParameterValue(String name)
getParameterValue
in interface javax.persistence.Query
public Object getParameterValue(int index)
getParameterValue
in interface javax.persistence.Query
public Set<javax.persistence.Parameter<?>> getParameters()
getParameters
in interface javax.persistence.Query
public boolean isBound(javax.persistence.Parameter<?> arg0)
isBound
in interface javax.persistence.Query
public <T> T unwrap(Class<T> arg0)
unwrap
in interface javax.persistence.Query
public List<X> getResultList()
getResultList
in interface javax.persistence.Query
getResultList
in interface javax.persistence.TypedQuery<X>
public X getSingleResult()
getSingleResult
in interface javax.persistence.Query
getSingleResult
in interface javax.persistence.TypedQuery<X>
public javax.persistence.TypedQuery<X> setFirstResult(int arg0)
setFirstResult
in interface javax.persistence.Query
setFirstResult
in interface javax.persistence.TypedQuery<X>
public javax.persistence.TypedQuery<X> setFlushMode(javax.persistence.FlushModeType arg0)
setFlushMode
in interface javax.persistence.Query
setFlushMode
in interface javax.persistence.TypedQuery<X>
public javax.persistence.TypedQuery<X> setHint(String arg0, Object arg1)
setHint
in interface javax.persistence.Query
setHint
in interface javax.persistence.TypedQuery<X>
public javax.persistence.TypedQuery<X> setLockMode(javax.persistence.LockModeType arg0)
setLockMode
in interface javax.persistence.Query
setLockMode
in interface javax.persistence.TypedQuery<X>
public javax.persistence.TypedQuery<X> setMaxResults(int arg0)
setMaxResults
in interface javax.persistence.Query
setMaxResults
in interface javax.persistence.TypedQuery<X>
public <T> javax.persistence.TypedQuery<X> setParameter(javax.persistence.Parameter<T> arg0, T arg1)
setParameter
in interface javax.persistence.Query
setParameter
in interface javax.persistence.TypedQuery<X>
public javax.persistence.TypedQuery<X> setParameter(String name, Object parameter)
setParameter
in interface javax.persistence.Query
setParameter
in interface javax.persistence.TypedQuery<X>
public javax.persistence.TypedQuery<X> setParameter(int index, Object parameter)
setParameter
in interface javax.persistence.Query
setParameter
in interface javax.persistence.TypedQuery<X>
public javax.persistence.TypedQuery<X> setParameter(javax.persistence.Parameter<Calendar> arg0, Calendar arg1, javax.persistence.TemporalType arg2)
setParameter
in interface javax.persistence.Query
setParameter
in interface javax.persistence.TypedQuery<X>
public javax.persistence.TypedQuery<X> setParameter(javax.persistence.Parameter<Date> arg0, Date arg1, javax.persistence.TemporalType arg2)
setParameter
in interface javax.persistence.Query
setParameter
in interface javax.persistence.TypedQuery<X>
public javax.persistence.TypedQuery<X> setParameter(String arg0, Calendar arg1, javax.persistence.TemporalType arg2)
setParameter
in interface javax.persistence.Query
setParameter
in interface javax.persistence.TypedQuery<X>
public javax.persistence.TypedQuery<X> setParameter(String arg0, Date arg1, javax.persistence.TemporalType arg2)
setParameter
in interface javax.persistence.Query
setParameter
in interface javax.persistence.TypedQuery<X>
public javax.persistence.TypedQuery<X> setParameter(int arg0, Calendar arg1, javax.persistence.TemporalType arg2)
setParameter
in interface javax.persistence.Query
setParameter
in interface javax.persistence.TypedQuery<X>
public javax.persistence.TypedQuery<X> setParameter(int arg0, Date arg1, javax.persistence.TemporalType arg2)
setParameter
in interface javax.persistence.Query
setParameter
in interface javax.persistence.TypedQuery<X>
Copyright © 2001–2016 mmm-Team. All rights reserved.