made em configurable (required for unit testing)
This commit is contained in:
@ -56,6 +56,11 @@ public abstract class CommonAbstractController {
|
|||||||
@ApplicationPU
|
@ApplicationPU
|
||||||
protected EntityManager em;
|
protected EntityManager em;
|
||||||
|
|
||||||
|
// required for unit testing
|
||||||
|
public void setEntityManager (EntityManager em) {
|
||||||
|
this.em = em;
|
||||||
|
}
|
||||||
|
|
||||||
@Lock(LockType.READ)
|
@Lock(LockType.READ)
|
||||||
public <T extends Serializable> T find(Class<T> clazz, Object id) {
|
public <T extends Serializable> T find(Class<T> clazz, Object id) {
|
||||||
return em.find(clazz, id);
|
return em.find(clazz, id);
|
||||||
|
|||||||
Reference in New Issue
Block a user