org.mentawai.db
Class JPAHandler

java.lang.Object
  extended by org.mentawai.db.JPAHandler
All Implemented Interfaces:
org.mentacontainer.Factory, org.mentacontainer.Interceptor<javax.persistence.EntityManager>

public class JPAHandler
extends Object
implements org.mentacontainer.Factory, org.mentacontainer.Interceptor<javax.persistence.EntityManager>

Handler for JPA Stuff.

Author:
Robert W. Gil

Constructor Summary
JPAHandler(javax.persistence.EntityManagerFactory entityManagerFactory, boolean transactional)
           
JPAHandler(String persisnteceUnitName, boolean transactional)
           
 
Method Summary
<T> T
getInstance()
           
 Class<? extends Object> getType()
           
 void onCleared(javax.persistence.EntityManager entityManager)
           
 void onCreated(javax.persistence.EntityManager entityManager)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JPAHandler

public JPAHandler(javax.persistence.EntityManagerFactory entityManagerFactory,
                  boolean transactional)
Parameters:
entityManagerFactory - the entity manager factory
transactional - if true, the transaction always be created and commited

JPAHandler

public JPAHandler(String persisnteceUnitName,
                  boolean transactional)
Parameters:
persisnteceUnitName - persisten unit name
transactional - if true, the transaction always be created and commited
Method Detail

getType

public Class<? extends Object> getType()
Specified by:
getType in interface org.mentacontainer.Factory

getInstance

public <T> T getInstance()
Specified by:
getInstance in interface org.mentacontainer.Factory

onCreated

public void onCreated(javax.persistence.EntityManager entityManager)
Specified by:
onCreated in interface org.mentacontainer.Interceptor<javax.persistence.EntityManager>

onCleared

public void onCleared(javax.persistence.EntityManager entityManager)
Specified by:
onCleared in interface org.mentacontainer.Interceptor<javax.persistence.EntityManager>


Copyright © 2013. All Rights Reserved.