Package be.gaudry.dao.jpa.test
Class JpaGenericLightObjectTest<T extends ILightObject>
java.lang.Object
be.gaudry.dao.jpa.test.JpaGenericLightObjectTest<T>
- Type Parameters:
- T-
- Direct Known Subclasses:
- JpaLightObjectTest,- JpaPersonExtTest,- JpaPersonTest
- Since:
- 1.0 Oct 6, 2010, 1.0
- Version:
- %I%, %G%
- Author:
- Steph GAUDRY
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidTests more deeply theEntityManager.persist(Object)method by inserting a newAbstractLightObjectinto the database.voidcleanDB()Cleans the database and restore beginning data to start on a well known statestatic voidcloseAll()static voidvoidTests quickly theEntityManager.persist(Object)method by inserting a newAbstractLightObjectinto the database.protected abstract TcreateObject(String display)voidLoad twice a same DB object into 2 Java Objects, modifies one, checks 2nd has been updated, and load a third Java Object to check if the modifications has been persistedprotected abstract Stringprotected abstract intprotected abstract org.dbunit.dataset.IDataSetprotected abstract StringvoidvoidTests the loading by id of aAbstractLightObjectinjected into the database.voidTests the loading by id of aAbstractLightObjectinjected into the database.voidvoidCloses and creates a new EntityManager to detach objects from the context
- 
Field Details- 
emprotected static javax.persistence.EntityManager em
- 
txprotected javax.persistence.EntityTransaction tx
- 
MSGLINE
- 
tableNameName of the table for the T class, used into native SQL. Default value is class simple name (like for the JPQL queries).
 
- 
- 
Constructor Details- 
JpaGenericLightObjectTest
 
- 
- 
Method Details- 
getDataSet- Throws:
- Exception
 
- 
getEntityManagerName
- 
getCheckedItemDisplay
- 
getCheckedItemIdprotected abstract int getCheckedItemId()
- 
createObject
- 
closeAll- Throws:
- SQLException
 
- 
closeEntityManagerpublic static void closeEntityManager()
- 
resetEntityManagerCloses and creates a new EntityManager to detach objects from the context- Throws:
- Exception
 
- 
initTransactionpublic final void initTransaction()
- 
cleanDBCleans the database and restore beginning data to start on a well known state- Throws:
- Exception
 
- 
createLightObjectTests quickly theEntityManager.persist(Object)method by inserting a newAbstractLightObjectinto the database.- Throws:
- Exception
 
- 
loadLightObjectByIdTests the loading by id of aAbstractLightObjectinjected into the database.- Throws:
- Exception
 
- 
loadLightObjectByDisplayTests the loading by id of aAbstractLightObjectinjected into the database.- Throws:
- Exception
 
- 
addAndRemoveLightObjectsTests more deeply theEntityManager.persist(Object)method by inserting a newAbstractLightObjectinto the database. Tests also theEntityManager.remove(Object)method.- Throws:
- Exception
 
- 
modifyLightObject- Throws:
- Exception
 
- 
crossModificationLoad twice a same DB object into 2 Java Objects, modifies one, checks 2nd has been updated, and load a third Java Object to check if the modifications has been persisted- Throws:
- Exception
 
 
-