com.github.smokestack.jpa
Class MockEntityManager

java.lang.Object
  extended by com.github.smokestack.jpa.MockEntityManager
All Implemented Interfaces:
EntityManager

public class MockEntityManager
extends Object
implements EntityManager

Author:
gliptak

Nested Class Summary
static class MockEntityManager.EntityManagerState
           
 
Field Summary
protected  FlushModeType flushModeType
           
protected  Map map
           
protected  MockEntityTransaction mockEntityTransaction
           
protected  MockEntityManager.EntityManagerState mockState
           
 
Constructor Summary
MockEntityManager()
          Constructor
MockEntityManager(Map map)
          Constructor
 
Method Summary
 void _close()
           
 Query _createNamedQuery(String name)
           
 Query _createNativeQuery(String sqlString)
           
 Query _createNativeQuery(String sqlString, Class resultClass)
           
 Query _createNativeQuery(String sqlString, String resultSetMapping)
           
 Query _createQuery(String qlString)
           
<T> T
_find(Class<T> arg0, Object arg1)
           
 FlushModeType _getFlushMode()
           
<T> T
_getReference(Class<T> arg0, Object arg1)
           
 EntityTransaction _getTransaction()
           
 boolean _isOpen()
           
<T> T
_merge(T arg0)
           
 void _persist(Object arg0)
           
 void _refresh(Object arg0)
           
 void _remove(Object arg0)
           
 void _setFlushMode(FlushModeType flushModeType)
           
 void assertMockCommit()
          Validation
 void assertMockComplete()
          Validation
 void assertMockRollback()
          Validation
 void clear()
           
 void close()
           
 boolean contains(Object entity)
           
 Query createNamedQuery(String name)
           
 Query createNativeQuery(String sqlString)
           
 Query createNativeQuery(String sqlString, Class resultClass)
           
 Query createNativeQuery(String sqlString, String resultSetMapping)
           
 Query createQuery(String qlString)
           
<T> T
find(Class<T> arg0, Object arg1)
           
 void flush()
           
 Object getDelegate()
           
 FlushModeType getFlushMode()
           
 MockEntityTransaction getMockEntityTransaction()
           
 MockEntityManager.EntityManagerState getMockState()
           
<T> T
getReference(Class<T> arg0, Object arg1)
           
 EntityTransaction getTransaction()
           
 boolean isOpen()
           
 void joinTransaction()
           
 void lock(Object arg0, LockModeType arg1)
           
<T> T
merge(T arg0)
           
 void persist(Object arg0)
           
 void refresh(Object arg0)
           
 void remove(Object arg0)
           
 void setFlushMode(FlushModeType flushModeType)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

map

protected Map map

flushModeType

protected FlushModeType flushModeType

mockEntityTransaction

protected MockEntityTransaction mockEntityTransaction

mockState

protected MockEntityManager.EntityManagerState mockState
Constructor Detail

MockEntityManager

public MockEntityManager()
Constructor


MockEntityManager

public MockEntityManager(Map map)
Constructor

Method Detail

clear

public void clear()
Specified by:
clear in interface EntityManager

close

public void close()
Specified by:
close in interface EntityManager

_close

public void _close()

contains

public boolean contains(Object entity)
Specified by:
contains in interface EntityManager

createNamedQuery

public Query createNamedQuery(String name)
Specified by:
createNamedQuery in interface EntityManager

_createNamedQuery

public Query _createNamedQuery(String name)

createNativeQuery

public Query createNativeQuery(String sqlString)
Specified by:
createNativeQuery in interface EntityManager

_createNativeQuery

public Query _createNativeQuery(String sqlString)

createNativeQuery

public Query createNativeQuery(String sqlString,
                               Class resultClass)
Specified by:
createNativeQuery in interface EntityManager

_createNativeQuery

public Query _createNativeQuery(String sqlString,
                                Class resultClass)

createNativeQuery

public Query createNativeQuery(String sqlString,
                               String resultSetMapping)
Specified by:
createNativeQuery in interface EntityManager

_createNativeQuery

public Query _createNativeQuery(String sqlString,
                                String resultSetMapping)

createQuery

public Query createQuery(String qlString)
Specified by:
createQuery in interface EntityManager

_createQuery

public Query _createQuery(String qlString)

find

public <T> T find(Class<T> arg0,
                  Object arg1)
Specified by:
find in interface EntityManager

_find

public <T> T _find(Class<T> arg0,
                   Object arg1)

flush

public void flush()
Specified by:
flush in interface EntityManager

getDelegate

public Object getDelegate()
Specified by:
getDelegate in interface EntityManager

getFlushMode

public FlushModeType getFlushMode()
Specified by:
getFlushMode in interface EntityManager

_getFlushMode

public FlushModeType _getFlushMode()

getReference

public <T> T getReference(Class<T> arg0,
                          Object arg1)
Specified by:
getReference in interface EntityManager

_getReference

public <T> T _getReference(Class<T> arg0,
                           Object arg1)

getTransaction

public EntityTransaction getTransaction()
Specified by:
getTransaction in interface EntityManager

_getTransaction

public EntityTransaction _getTransaction()

isOpen

public boolean isOpen()
Specified by:
isOpen in interface EntityManager

_isOpen

public boolean _isOpen()

joinTransaction

public void joinTransaction()
Specified by:
joinTransaction in interface EntityManager

lock

public void lock(Object arg0,
                 LockModeType arg1)
Specified by:
lock in interface EntityManager

merge

public <T> T merge(T arg0)
Specified by:
merge in interface EntityManager

_merge

public <T> T _merge(T arg0)

persist

public void persist(Object arg0)
Specified by:
persist in interface EntityManager

_persist

public void _persist(Object arg0)

refresh

public void refresh(Object arg0)
Specified by:
refresh in interface EntityManager

_refresh

public void _refresh(Object arg0)

remove

public void remove(Object arg0)
Specified by:
remove in interface EntityManager

_remove

public void _remove(Object arg0)

setFlushMode

public void setFlushMode(FlushModeType flushModeType)
Specified by:
setFlushMode in interface EntityManager

_setFlushMode

public void _setFlushMode(FlushModeType flushModeType)

toString

public String toString()
Overrides:
toString in class Object

assertMockComplete

public void assertMockComplete()
Validation


assertMockCommit

public void assertMockCommit()
Validation


assertMockRollback

public void assertMockRollback()
Validation


getMockState

public MockEntityManager.EntityManagerState getMockState()

getMockEntityTransaction

public MockEntityTransaction getMockEntityTransaction()


Copyright © 2009-2010 Smokestack. All Rights Reserved.