org.mockejb
Interface EntityDatabase
- public interface EntityDatabase
Provides in-memory entity database implementation suitable for
setting up test mock data.
Entities can be searched only by the primary key.
Users should populate EntityDatabase with the mock entities for their test.
MockEJB searches EntityDatabase:
1) During the call to CMP findByPrimaryKey.
2) After a BMP finder returns a PK or collection of PKs.
MockEJB automatically add an entity to this "database" if
its ejbCreate method returns a PK.
Note that you can use aspects/interceptors to intercept all calls to this
class.
- Author:
- Alexander Ananiev
Method Summary |
void |
add(java.lang.Class homeIfaceClass,
java.lang.Object pk,
java.lang.Object entity)
|
void |
clear()
|
java.lang.Object |
find(java.lang.Class homeIfaceClass,
java.lang.Object pk)
|
add
public void add(java.lang.Class homeIfaceClass,
java.lang.Object pk,
java.lang.Object entity)
find
public java.lang.Object find(java.lang.Class homeIfaceClass,
java.lang.Object pk)
clear
public void clear()