public class HelloTwoDbsMain extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ALL_COMPLEX_DATA
Named query to find all ComplexData objects
|
static String |
ALL_SIMPLE_DATA
Named query to find all SimpleData objects
|
static String |
DATABASE_INFO_NAME |
static String |
PU_NAME1 |
static String |
PU_NAME2 |
static Object |
SEPARATOR_LINE |
static String |
TAG |
| Constructor and Description |
|---|
HelloTwoDbsMain()
Create HelloTwoDbsMain object
This creates and populates the database using JPA and runs a test from main().
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearDatabaseTables()
Clear database tables if they exist
|
void |
displayMessage(String message)
Display message to user
|
void |
dropDatabaseTables() |
void |
dropDatabaseVersionTable(String puName) |
static void |
logInfo(String tag,
String message)
Public accessor for logMessage()
|
void |
logMessage(String tag,
String message)
Log message
|
static void |
main(String[] args)
Test 2 Databases accessed by application
|
void |
performPersistenceWork(String puName,
PersistenceTask persistenceTask)
Launch persistence work to run in background thread and wait for completion
|
void |
populateDatabases()
Populate databases with initial sample data
|
void |
setUp()
Populate entity tables.
|
void |
setUp(boolean fromStart) |
void |
shutdown() |
public static final String TAG
public static final String PU_NAME1
public static final String PU_NAME2
public static final String ALL_SIMPLE_DATA
public static final String ALL_COMPLEX_DATA
public static final String DATABASE_INFO_NAME
public static final Object SEPARATOR_LINE
public HelloTwoDbsMain()
public static void main(String[] args)
args - Not usedpublic void setUp()
throws InterruptedException
InterruptedExceptionpublic void setUp(boolean fromStart)
throws InterruptedException
InterruptedExceptionpublic void shutdown()
public void performPersistenceWork(String puName, PersistenceTask persistenceTask) throws InterruptedException
puName - Persistence Unit namepersistenceTask - PersistenceTask objectInterruptedExceptionpublic void logMessage(String tag, String message)
tag - message - public void displayMessage(String message)
message - public void clearDatabaseTables()
throws InterruptedException
InterruptedExceptionpublic void dropDatabaseTables()
throws InterruptedException
InterruptedExceptionpublic void dropDatabaseVersionTable(String puName) throws InterruptedException
InterruptedExceptionpublic void populateDatabases()
throws InterruptedException
InterruptedExceptionThis documentation is licensed by Andrew Bowley under the GPLv3 License.