com.github.smokestack.jpa
Class MockBaseQuery

java.lang.Object
  extended by com.github.smokestack.jpa.MockBaseQuery
All Implemented Interfaces:
Query
Direct Known Subclasses:
MockNamedQuery, MockNativeQuery, MockQLQuery

public abstract class MockBaseQuery
extends Object
implements Query

Common query functionality.

Author:
gliptak

Field Summary
protected  FlushModeType flushMode
           
protected  Map<String,Object> hints
           
protected  int maxResult
           
protected  int startPosition
           
 
Constructor Summary
protected MockBaseQuery()
           
 
Method Summary
 int _executeUpdate()
           
 List _getResultList()
           
 Object _getSingleResult()
           
 Object _getTemporalType(Calendar value, TemporalType type)
           
 Query _setFirstResult(int startPosition2)
           
 Query _setFlushMode(FlushModeType flushMode)
           
 Query _setHint(String hintName, Object value)
           
 Query _setMaxResults(int maxResult)
           
 Query _setParameter(int position, Object value)
           
 Query _setParameter(String name, Calendar value, TemporalType temporalType)
           
 Query _setParameter(String name, Date value, TemporalType temporalType)
           
 Query _setParameter(String name, Object value)
           
 int executeUpdate()
           
 List getResultList()
           
 Object getSingleResult()
           
protected  Object getTemporalType(Calendar value, TemporalType type)
          Convert TemporalType
protected  Object getTemporalType(Date value, TemporalType type)
          Convert TemporalType
 Query setFirstResult(int startPosition)
           
 Query setFlushMode(FlushModeType flushMode)
           
 Query setHint(String hintName, Object value)
           
 Query setMaxResults(int maxResult)
           
 Query setParameter(int position, Calendar value, TemporalType temporalType)
           
 Query setParameter(int position, Date value, TemporalType temporalType)
           
 Query setParameter(int position, Object value)
           
 Query setParameter(String name, Calendar value, TemporalType temporalType)
           
 Query setParameter(String name, Date value, TemporalType temporalType)
           
 Query setParameter(String name, Object value)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

startPosition

protected int startPosition

flushMode

protected FlushModeType flushMode

hints

protected Map<String,Object> hints

maxResult

protected int maxResult
Constructor Detail

MockBaseQuery

protected MockBaseQuery()
Method Detail

executeUpdate

public int executeUpdate()
Specified by:
executeUpdate in interface Query

_executeUpdate

public int _executeUpdate()

getResultList

public List getResultList()
Specified by:
getResultList in interface Query

_getResultList

public List _getResultList()

getSingleResult

public Object getSingleResult()
Specified by:
getSingleResult in interface Query

_getSingleResult

public Object _getSingleResult()

setFirstResult

public Query setFirstResult(int startPosition)
Specified by:
setFirstResult in interface Query

_setFirstResult

public Query _setFirstResult(int startPosition2)

setFlushMode

public Query setFlushMode(FlushModeType flushMode)
Specified by:
setFlushMode in interface Query

_setFlushMode

public Query _setFlushMode(FlushModeType flushMode)

setHint

public Query setHint(String hintName,
                     Object value)
Specified by:
setHint in interface Query

_setHint

public Query _setHint(String hintName,
                      Object value)

setMaxResults

public Query setMaxResults(int maxResult)
Specified by:
setMaxResults in interface Query

_setMaxResults

public Query _setMaxResults(int maxResult)

setParameter

public Query setParameter(String name,
                          Object value)
Specified by:
setParameter in interface Query

_setParameter

public Query _setParameter(String name,
                           Object value)

setParameter

public Query setParameter(int position,
                          Object value)
Specified by:
setParameter in interface Query

_setParameter

public Query _setParameter(int position,
                           Object value)

setParameter

public Query setParameter(String name,
                          Date value,
                          TemporalType temporalType)
Specified by:
setParameter in interface Query

_setParameter

public Query _setParameter(String name,
                           Date value,
                           TemporalType temporalType)

setParameter

public Query setParameter(String name,
                          Calendar value,
                          TemporalType temporalType)
Specified by:
setParameter in interface Query

_setParameter

public Query _setParameter(String name,
                           Calendar value,
                           TemporalType temporalType)

setParameter

public Query setParameter(int position,
                          Date value,
                          TemporalType temporalType)
Specified by:
setParameter in interface Query

setParameter

public Query setParameter(int position,
                          Calendar value,
                          TemporalType temporalType)
Specified by:
setParameter in interface Query

getTemporalType

protected Object getTemporalType(Date value,
                                 TemporalType type)
Convert TemporalType

Parameters:
value -
type -
Returns:

getTemporalType

protected Object getTemporalType(Calendar value,
                                 TemporalType type)
Convert TemporalType

Parameters:
value -
type -
Returns:

_getTemporalType

public Object _getTemporalType(Calendar value,
                               TemporalType type)

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009-2010 Smokestack. All Rights Reserved.