git://wamblee.org
/
utils
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
c63e76e
)
javadoc updates
author
Erik Brakkee
<erik@brakkee.org>
Mon, 5 Jul 2010 15:03:29 +0000
(15:03 +0000)
committer
Erik Brakkee
<erik@brakkee.org>
Mon, 5 Jul 2010 15:03:29 +0000
(15:03 +0000)
13 files changed:
test/enterprise/src/main/java/org/wamblee/support/ThreadSpecificProxyFactory.java
patch
|
blob
|
history
test/enterprise/src/main/java/org/wamblee/support/persistence/AbstractDatabase.java
patch
|
blob
|
history
test/enterprise/src/main/java/org/wamblee/support/persistence/AbstractDatabaseProvider.java
patch
|
blob
|
history
test/enterprise/src/main/java/org/wamblee/support/persistence/CompositeJpaCustomizer.java
patch
|
blob
|
history
test/enterprise/src/main/java/org/wamblee/support/persistence/CompositeJpaTables.java
patch
|
blob
|
history
test/enterprise/src/main/java/org/wamblee/support/persistence/DatabaseBuilder.java
patch
|
blob
|
history
test/enterprise/src/main/java/org/wamblee/support/persistence/DatabaseStarter.java
patch
|
blob
|
history
test/enterprise/src/main/java/org/wamblee/support/persistence/DatabaseUtils.java
patch
|
blob
|
history
test/enterprise/src/main/java/org/wamblee/support/persistence/DerbyDatabaseProvider.java
patch
|
blob
|
history
test/enterprise/src/main/java/org/wamblee/support/persistence/ExternalDatabaseProvider.java
patch
|
blob
|
history
test/enterprise/src/main/java/org/wamblee/support/persistence/JpaCustomizer.java
patch
|
blob
|
history
test/enterprise/src/main/java/org/wamblee/support/persistence/JpaCustomizerBuilder.java
patch
|
blob
|
history
test/enterprise/src/main/java/org/wamblee/support/persistence/JpaTester.java
patch
|
blob
|
history
diff --git
a/test/enterprise/src/main/java/org/wamblee/support/ThreadSpecificProxyFactory.java
b/test/enterprise/src/main/java/org/wamblee/support/ThreadSpecificProxyFactory.java
index 02668cdc9cbb3cdfbf04437e5c2c32778b0d4543..26a7610450991d92e5a4619cd6cafd273f0b0e36 100644
(file)
--- a/
test/enterprise/src/main/java/org/wamblee/support/ThreadSpecificProxyFactory.java
+++ b/
test/enterprise/src/main/java/org/wamblee/support/ThreadSpecificProxyFactory.java
@@
-26,6
+26,12
@@
import java.lang.reflect.Proxy;
*
* It is used for instance to pass a transaction scoped entity manager around.
*
*
* It is used for instance to pass a transaction scoped entity manager around.
*
+ * The {@link #set(Object)} method sets the current service instance for the current thread.
+ * The {@link #get()} method gets the current service instance for the current thread.
+ * The {@link #getProxy()} method gets a proxy that will delegate at runtime to the thread-specific
+ * instance. The result from this method can be passed at construction of an object that will be used
+ * by multiple threads.
+ *
* @param T
* Interface to proxy.
* @author Erik Brakkee
* @param T
* Interface to proxy.
* @author Erik Brakkee
diff --git
a/test/enterprise/src/main/java/org/wamblee/support/persistence/AbstractDatabase.java
b/test/enterprise/src/main/java/org/wamblee/support/persistence/AbstractDatabase.java
index 6eaba50b880f9a218e35ed54a0a3d22aea8168e4..12c82c41177b7fe9f66d239d1d642d4218c0a1b9 100644
(file)
--- a/
test/enterprise/src/main/java/org/wamblee/support/persistence/AbstractDatabase.java
+++ b/
test/enterprise/src/main/java/org/wamblee/support/persistence/AbstractDatabase.java
@@
-28,6
+28,14
@@
import org.apache.commons.dbcp.PoolableConnectionFactory;
import org.apache.commons.dbcp.PoolingDataSource;
import org.apache.commons.pool.impl.GenericObjectPool;
import org.apache.commons.dbcp.PoolingDataSource;
import org.apache.commons.pool.impl.GenericObjectPool;
+/**
+ * Abstract database class providing the creation of the datasource,
+ * preventing duplicate starts of the same database, and checking
+ * for connection leaks when the database is stopped.
+ *
+ * @author Erik Brakkee
+ *
+ */
public abstract class AbstractDatabase implements Database {
/**
public abstract class AbstractDatabase implements Database {
/**
@@
-47,12
+55,21
@@
public abstract class AbstractDatabase implements Database {
private boolean started;
private boolean started;
+ /**
+ * Constructs the database.
+ */
protected AbstractDatabase() {
started = false;
}
protected AbstractDatabase() {
started = false;
}
+ /**
+ * To be implemented by subclasses to start the database.
+ */
protected abstract void doStart();
protected abstract void doStart();
+ /**
+ * To be implemented by subclasses to stop the database.
+ */
protected abstract void doStop();
/**
protected abstract void doStop();
/**
@@
-83,6
+100,9
@@
public abstract class AbstractDatabase implements Database {
// / BELOW THIS LINE IS NOT OF INTEREST TO SUBCLASSES.
// / BELOW THIS LINE IS NOT OF INTEREST TO SUBCLASSES.
+ /**
+ * Starts the database.
+ */
public final DataSource start() {
if (started) {
throw new RuntimeException("Database already started");
public final DataSource start() {
if (started) {
throw new RuntimeException("Database already started");
@@
-92,6
+112,11
@@
public abstract class AbstractDatabase implements Database {
return getDatasource();
}
return getDatasource();
}
+ /**
+ * Stops the database and tests for connection leaks.
+ * In cast the system property with the name given by {@link #IGNORE_CONNECTION_LEAK_PROPERTY}
+ * is set then the connection leaks are not checked.
+ */
public final void stop() {
if (!started) {
return; // nothing to do.
public final void stop() {
if (!started) {
return; // nothing to do.
diff --git
a/test/enterprise/src/main/java/org/wamblee/support/persistence/AbstractDatabaseProvider.java
b/test/enterprise/src/main/java/org/wamblee/support/persistence/AbstractDatabaseProvider.java
index 65cca2b08a1c799c98677f6ed311213b09621a7c..b15d53b398a4381659a431b3988d4c2691954597 100644
(file)
--- a/
test/enterprise/src/main/java/org/wamblee/support/persistence/AbstractDatabaseProvider.java
+++ b/
test/enterprise/src/main/java/org/wamblee/support/persistence/AbstractDatabaseProvider.java
@@
-16,11
+16,21
@@
package org.wamblee.support.persistence;
import java.util.List;
package org.wamblee.support.persistence;
import java.util.List;
-
+/**
+ * Base class for database providers.
+ *
+ * @author Erik Brakkee
+ */
public abstract class AbstractDatabaseProvider implements DatabaseProvider {
public abstract class AbstractDatabaseProvider implements DatabaseProvider {
+ /**
+ * @return List of database capabilities.
+ */
protected abstract List<String> getCapabilities();
protected abstract List<String> getCapabilities();
+ /**
+ * Standard implementation of the capabalities check.
+ */
public final boolean supportsCapabilities(String[] aCapabilities) {
for (String capability : aCapabilities) {
if (!getCapabilities().contains(capability)) {
public final boolean supportsCapabilities(String[] aCapabilities) {
for (String capability : aCapabilities) {
if (!getCapabilities().contains(capability)) {
diff --git
a/test/enterprise/src/main/java/org/wamblee/support/persistence/CompositeJpaCustomizer.java
b/test/enterprise/src/main/java/org/wamblee/support/persistence/CompositeJpaCustomizer.java
index cdc264d71694a7951cc50006b74c56bd9820e3c1..3d8c7b8a0a23451c108a00c4320d9f169b8b2a7f 100644
(file)
--- a/
test/enterprise/src/main/java/org/wamblee/support/persistence/CompositeJpaCustomizer.java
+++ b/
test/enterprise/src/main/java/org/wamblee/support/persistence/CompositeJpaCustomizer.java
@@
-20,11
+20,21
@@
import java.util.Map;
import org.dbunit.dataset.filter.ITableFilterSimple;
import org.dbunit.dataset.filter.ITableFilterSimple;
+/**
+ * Composite JPA customizer that applies the customizations from several
+ * JPA customizers.
+ *
+ * @author Erik Brakkee
+ */
public class CompositeJpaCustomizer implements JpaCustomizer {
private List<JpaCustomizer> customizers;
private CompositeJpaTables tables;
public class CompositeJpaCustomizer implements JpaCustomizer {
private List<JpaCustomizer> customizers;
private CompositeJpaTables tables;
+ /**
+ * Construcst the customizer.
+ * @param aCustomizers List of customizers.
+ */
public CompositeJpaCustomizer(List<JpaCustomizer> aCustomizers) {
customizers = aCustomizers;
tables = new CompositeJpaTables();
public CompositeJpaCustomizer(List<JpaCustomizer> aCustomizers) {
customizers = aCustomizers;
tables = new CompositeJpaTables();
@@
-34,6
+44,9
@@
public class CompositeJpaCustomizer implements JpaCustomizer {
}
@Override
}
@Override
+ /**
+ * Applies all customizations in an undefined order.
+ */
public void customize(PersistenceUnitDescription aPersistenceUnit,
Map<String, String> aJpaProperties) {
for (JpaCustomizer customizer : customizers) {
public void customize(PersistenceUnitDescription aPersistenceUnit,
Map<String, String> aJpaProperties) {
for (JpaCustomizer customizer : customizers) {
diff --git
a/test/enterprise/src/main/java/org/wamblee/support/persistence/CompositeJpaTables.java
b/test/enterprise/src/main/java/org/wamblee/support/persistence/CompositeJpaTables.java
index 25f4894db5b986a59ad96a837aacd9e6f09f3779..b44ff7cce56e52ca6ae8622772782b9eaa7613aa 100644
(file)
--- a/
test/enterprise/src/main/java/org/wamblee/support/persistence/CompositeJpaTables.java
+++ b/
test/enterprise/src/main/java/org/wamblee/support/persistence/CompositeJpaTables.java
@@
-21,14
+21,26
@@
import java.util.List;
import org.dbunit.dataset.DataSetException;
import org.dbunit.dataset.filter.ITableFilterSimple;
import org.dbunit.dataset.DataSetException;
import org.dbunit.dataset.filter.ITableFilterSimple;
+/**
+ * Composite JPA tables. Implements the logical or of several table filters.
+ *
+ * @author Erik Brakkee
+ */
public class CompositeJpaTables implements ITableFilterSimple {
private List<ITableFilterSimple> tables;
public class CompositeJpaTables implements ITableFilterSimple {
private List<ITableFilterSimple> tables;
+ /**
+ * Construcst the tables.
+ */
public CompositeJpaTables() {
tables = new ArrayList<ITableFilterSimple>();
}
public CompositeJpaTables() {
tables = new ArrayList<ITableFilterSimple>();
}
+ /**
+ * Adds a table filter.
+ * @param aFilter filter.
+ */
public void add(ITableFilterSimple aFilter) {
tables.add(aFilter);
}
public void add(ITableFilterSimple aFilter) {
tables.add(aFilter);
}
diff --git
a/test/enterprise/src/main/java/org/wamblee/support/persistence/DatabaseBuilder.java
b/test/enterprise/src/main/java/org/wamblee/support/persistence/DatabaseBuilder.java
index d8807c389717b36a65142bf0ac44b7a222ad7f29..6f4956980856d2a0d7df4e06ac588a79d2957d3f 100644
(file)
--- a/
test/enterprise/src/main/java/org/wamblee/support/persistence/DatabaseBuilder.java
+++ b/
test/enterprise/src/main/java/org/wamblee/support/persistence/DatabaseBuilder.java
@@
-65,6
+65,9
@@
public class DatabaseBuilder {
private static ServiceLoader<DatabaseProvider> LOADER =
ServiceLoader.load(DatabaseProvider.class);
private static ServiceLoader<DatabaseProvider> LOADER =
ServiceLoader.load(DatabaseProvider.class);
+ /**
+ * Constructs the database builder.
+ */
private DatabaseBuilder() {
// Empty.
}
private DatabaseBuilder() {
// Empty.
}
diff --git
a/test/enterprise/src/main/java/org/wamblee/support/persistence/DatabaseStarter.java
b/test/enterprise/src/main/java/org/wamblee/support/persistence/DatabaseStarter.java
index 45e964999476eab3697e453d15e2518991203759..1afefd808046667b129f91de6cfafd4fcb36ea37 100644
(file)
--- a/
test/enterprise/src/main/java/org/wamblee/support/persistence/DatabaseStarter.java
+++ b/
test/enterprise/src/main/java/org/wamblee/support/persistence/DatabaseStarter.java
@@
-16,7
+16,7
@@
package org.wamblee.support.persistence;
/**
package org.wamblee.support.persistence;
/**
- * This class is used for starting the database
from ant
.
+ * This class is used for starting the database
as a main program
.
*/
public class DatabaseStarter {
*/
public class DatabaseStarter {
diff --git
a/test/enterprise/src/main/java/org/wamblee/support/persistence/DatabaseUtils.java
b/test/enterprise/src/main/java/org/wamblee/support/persistence/DatabaseUtils.java
index b57cd46184e3c4293da6ca5e25c01f6aec8957cd..07dbca0f64363988f18c76da9bd599ba55ee2865 100644
(file)
--- a/
test/enterprise/src/main/java/org/wamblee/support/persistence/DatabaseUtils.java
+++ b/
test/enterprise/src/main/java/org/wamblee/support/persistence/DatabaseUtils.java
@@
-45,15
+45,44
@@
import org.dbunit.operation.DatabaseOperation;
*/
public class DatabaseUtils {
*/
public class DatabaseUtils {
+ /**
+ * Represents a set of tables.
+ *
+ * @author Erik Brakkee
+ */
public static interface TableSet {
boolean contains(String aTableName);
}
public static interface TableSet {
boolean contains(String aTableName);
}
+ /**
+ * Represents a unit of work (transaction).
+ *
+ * @author Erik Brakkee
+ *
+ * @param <T> Type of return value.
+ */
public static interface JdbcUnitOfWork<T> {
public static interface JdbcUnitOfWork<T> {
+ /**
+ * Executes statement within a transaction.
+ * @param aConnection Connection.
+ * @return Result of the work.
+ * @throws Exception
+ */
T execute(Connection aConnection) throws Exception;
}
T execute(Connection aConnection) throws Exception;
}
+ /**
+ * Operation to be executed on a set of tables for each table
+ * individually.
+ *
+ * @author Erik Brakkee
+ */
public static interface TableSetOperation {
public static interface TableSetOperation {
+ /**
+ * Executes on a table.
+ * @param aTable Table name.
+ * @throws Exception
+ */
void execute(String aTable) throws Exception;
}
void execute(String aTable) throws Exception;
}
@@
-108,10
+137,22
@@
public class DatabaseUtils {
connections.clear();
}
connections.clear();
}
+ /**
+ * Creates database tester.
+ * @param aTables Tables to create the tester for.
+ * @return Database tester.
+ * @throws Exception
+ */
public IDatabaseTester createDbTester(ITableFilterSimple aTables) throws Exception {
return createDbTester(getTableNames(aTables));
}
public IDatabaseTester createDbTester(ITableFilterSimple aTables) throws Exception {
return createDbTester(getTableNames(aTables));
}
-
+
+ /**
+ * Creates database tester.
+ * @param aTables Tables to create the tester for.
+ * @return Database tester.
+ * @throws Exception
+ */
public IDatabaseTester createDbTester(String[] aTables) throws Exception {
IDatabaseConnection connection = dbtester.getConnection();
connections.add(connection);
public IDatabaseTester createDbTester(String[] aTables) throws Exception {
IDatabaseConnection connection = dbtester.getConnection();
connections.add(connection);
@@
-119,6
+160,12
@@
public class DatabaseUtils {
return dbtester;
}
return dbtester;
}
+ /**
+ * Executes an operation on a set of tables.
+ * @param aTables Tables.
+ * @param aOperation Operation.
+ * @throws Exception
+ */
public void executeOnTables(ITableFilterSimple aTables,
final TableSetOperation aOperation) throws Exception {
final String[] tableNames = getTableNames(aTables);
public void executeOnTables(ITableFilterSimple aTables,
final TableSetOperation aOperation) throws Exception {
final String[] tableNames = getTableNames(aTables);
@@
-132,6
+179,12
@@
public class DatabaseUtils {
});
}
});
}
+ /**
+ * Cleans a number of database tables. This means deleting the content not dropping the tables.
+ * This may fail in case of cyclic dependencies between the tables (current limitation).
+ * @param aSelection Tables.
+ * @throws Exception
+ */
public void cleanDatabase(ITableFilterSimple aSelection) throws Exception {
final String[] tableNames = getTableNames(aSelection);
public void cleanDatabase(ITableFilterSimple aSelection) throws Exception {
final String[] tableNames = getTableNames(aSelection);
@@
-151,12
+204,19
@@
public class DatabaseUtils {
}
}
- public <T> T executeInTransaction(JdbcUnitOfWork<T> aCallback)
+ /**
+ * Executes a unit of work within a transaction.
+ * @param <T> Result type of th ework.
+ * @param aWork Unit of work.
+ * @return
+ * @throws Exception
+ */
+ public <T> T executeInTransaction(JdbcUnitOfWork<T> aWork)
throws Exception {
Connection connection = dataSource.getConnection();
connection.setAutoCommit(false);
try {
throws Exception {
Connection connection = dataSource.getConnection();
connection.setAutoCommit(false);
try {
- T value = a
Callbac
k.execute(connection);
+ T value = a
Wor
k.execute(connection);
connection.commit();
return value;
} finally {
connection.commit();
return value;
} finally {
@@
-165,7
+225,10
@@
public class DatabaseUtils {
}
/**
}
/**
- * @throws SQLException
+ * Returns table names based on a table filter.
+ * @param aSelection Table filter.
+ * @return Table names.
+ * @throws Exception
*/
public String[] getTableNames(ITableFilterSimple aSelection)
throws Exception {
*/
public String[] getTableNames(ITableFilterSimple aSelection)
throws Exception {
@@
-191,9
+254,9
@@
public class DatabaseUtils {
}
/**
}
/**
- * @return
- * @throws SQLException
+ * Use {@link #cleanDatabase(ITableFilterSimple)} instead.
*/
*/
+ @Deprecated
public void emptyTables(final ITableFilterSimple aSelection)
throws Exception {
executeOnTables(aSelection, new TableSetOperation() {
public void emptyTables(final ITableFilterSimple aSelection)
throws Exception {
executeOnTables(aSelection, new TableSetOperation() {
@@
-204,13
+267,18
@@
public class DatabaseUtils {
}
/**
}
/**
- * @return
- * @throws SQLException
+ * User {@link #cleanDatabase(ITableFilterSimple)} instead.
*/
*/
+ @Deprecated
public void emptyTable(String aTable) throws Exception {
executeSql("delete from " + aTable);
}
public void emptyTable(String aTable) throws Exception {
executeSql("delete from " + aTable);
}
+ /**
+ * Drops tables. This only works if there are no cyclic dependencies between the tables.
+ * @param aTables Tables to drop.
+ * @throws Exception
+ */
public void dropTables(ITableFilterSimple aTables) throws Exception {
final String[] tableNames = getTableNames(aTables);
String[] sortedTables = executeInTransaction(new JdbcUnitOfWork<String[]>() {
public void dropTables(ITableFilterSimple aTables) throws Exception {
final String[] tableNames = getTableNames(aTables);
String[] sortedTables = executeInTransaction(new JdbcUnitOfWork<String[]>() {
@@
-231,8
+299,9
@@
public class DatabaseUtils {
}
/**
}
/**
- * @return
- * @throws SQLException
+ * Drops a table.
+ * @param aTable Table to drop.
+ * @throws Exception
*/
public void dropTable(final String aTable) throws Exception {
executeInTransaction(new JdbcUnitOfWork<Void>() {
*/
public void dropTable(final String aTable) throws Exception {
executeInTransaction(new JdbcUnitOfWork<Void>() {
@@
-343,6
+412,13
@@
public class DatabaseUtils {
}
}
}
}
+ /**
+ * Executes an update.
+ * @param aConnection Connection to use.
+ * @param aSql SQL update to use.
+ * @param aArgs Arguments to the update.
+ * @return Number of rows updated.
+ */
public int executeUpdate(Connection aConnection, final String aSql,
final Object... aArgs) {
try {
public int executeUpdate(Connection aConnection, final String aSql,
final Object... aArgs) {
try {
@@
-400,7
+476,9
@@
public class DatabaseUtils {
}
/**
}
/**
- * @return
+ * Gets the table size.
+ * @param aTable Table.
+ * @return Table size.
* @throws SQLException
*/
public int getTableSize(final String aTable) throws Exception {
* @throws SQLException
*/
public int getTableSize(final String aTable) throws Exception {
@@
-415,6
+493,12
@@
public class DatabaseUtils {
}
}
+ /**
+ * Counts the results in a result set.
+ * @param aResultSet Resultset.
+ * @return Number of rows in the set.
+ * @throws SQLException
+ */
public int countResultSet(ResultSet aResultSet) throws SQLException {
int count = 0;
public int countResultSet(ResultSet aResultSet) throws SQLException {
int count = 0;
diff --git
a/test/enterprise/src/main/java/org/wamblee/support/persistence/DerbyDatabaseProvider.java
b/test/enterprise/src/main/java/org/wamblee/support/persistence/DerbyDatabaseProvider.java
index 183a73db03450d3d20a984f85b6ec6b30e1873c1..119c8c55efe6c05cf6cdfa60b59171cd101a12ac 100644
(file)
--- a/
test/enterprise/src/main/java/org/wamblee/support/persistence/DerbyDatabaseProvider.java
+++ b/
test/enterprise/src/main/java/org/wamblee/support/persistence/DerbyDatabaseProvider.java
@@
-19,9
+19,9
@@
import java.util.Arrays;
import java.util.List;
/**
import java.util.List;
/**
+ * Derby database provider.
*
*
- * @author $author$
- * @version $Revision$
+ * @author Erik Brakkee
*/
public class DerbyDatabaseProvider extends AbstractDatabaseProvider {
/**
*/
public class DerbyDatabaseProvider extends AbstractDatabaseProvider {
/**
diff --git
a/test/enterprise/src/main/java/org/wamblee/support/persistence/ExternalDatabaseProvider.java
b/test/enterprise/src/main/java/org/wamblee/support/persistence/ExternalDatabaseProvider.java
index 9c131bfbfdcfe7cd70507fb23262acee46601b64..5f6e0416ee47b7731014766bd9c019d9077baa65 100644
(file)
--- a/
test/enterprise/src/main/java/org/wamblee/support/persistence/ExternalDatabaseProvider.java
+++ b/
test/enterprise/src/main/java/org/wamblee/support/persistence/ExternalDatabaseProvider.java
@@
-18,6
+18,11
@@
package org.wamblee.support.persistence;
import java.util.Arrays;
import java.util.List;
import java.util.Arrays;
import java.util.List;
+/**
+ * Database provider for an external database.
+ *
+ * @author Erik Brakkee
+ */
public class ExternalDatabaseProvider extends AbstractDatabaseProvider {
/**
public class ExternalDatabaseProvider extends AbstractDatabaseProvider {
/**
diff --git
a/test/enterprise/src/main/java/org/wamblee/support/persistence/JpaCustomizer.java
b/test/enterprise/src/main/java/org/wamblee/support/persistence/JpaCustomizer.java
index 7c48cb248c226793879b6611d40ad0a6c83f7909..9914e2a1158db2a9d8257dc8f90cf86ace0b6193 100644
(file)
--- a/
test/enterprise/src/main/java/org/wamblee/support/persistence/JpaCustomizer.java
+++ b/
test/enterprise/src/main/java/org/wamblee/support/persistence/JpaCustomizer.java
@@
-32,8
+32,17
@@
import org.dbunit.dataset.filter.ITableFilterSimple;
*/
public interface JpaCustomizer {
*/
public interface JpaCustomizer {
+ /**
+ * Customizes the persistence unit through properties.
+ * @param aPersistenceUnit Persistence unit.
+ * @param aJpaProperties Current properties.
+ */
void customize(PersistenceUnitDescription aPersistenceUnit,
Map<String, String> aJpaProperties);
void customize(PersistenceUnitDescription aPersistenceUnit,
Map<String, String> aJpaProperties);
+ /**
+ * Gets the tables specific to the JPA provider.
+ * @return Tables.
+ */
ITableFilterSimple getJpaTables();
}
ITableFilterSimple getJpaTables();
}
diff --git
a/test/enterprise/src/main/java/org/wamblee/support/persistence/JpaCustomizerBuilder.java
b/test/enterprise/src/main/java/org/wamblee/support/persistence/JpaCustomizerBuilder.java
index 1f1884fe0fcc6b2743c8ce457a166c62639609a1..564e82461d61a09a80c74fe0003403727c9ca29b 100644
(file)
--- a/
test/enterprise/src/main/java/org/wamblee/support/persistence/JpaCustomizerBuilder.java
+++ b/
test/enterprise/src/main/java/org/wamblee/support/persistence/JpaCustomizerBuilder.java
@@
-19,11
+19,20
@@
import java.util.ArrayList;
import java.util.List;
import java.util.ServiceLoader;
import java.util.List;
import java.util.ServiceLoader;
+/**
+ * JPA customizer builder implements the {@link ServiceLoader} based mechanism for looking up
+ * JPA customizers.
+ */
public class JpaCustomizerBuilder {
private static final ServiceLoader<JpaCustomizer> CUSTOMIZERS = ServiceLoader
.load(JpaCustomizer.class);
public class JpaCustomizerBuilder {
private static final ServiceLoader<JpaCustomizer> CUSTOMIZERS = ServiceLoader
.load(JpaCustomizer.class);
+ /**
+ * Gets the customizer to use. This is a composite customizer that combines all customizers that
+ * were found.
+ * @return JPA customizer.
+ */
public static JpaCustomizer getCustomizer() {
List<JpaCustomizer> customizers = new ArrayList<JpaCustomizer>();
for (JpaCustomizer customizer : CUSTOMIZERS) {
public static JpaCustomizer getCustomizer() {
List<JpaCustomizer> customizers = new ArrayList<JpaCustomizer>();
for (JpaCustomizer customizer : CUSTOMIZERS) {
diff --git
a/test/enterprise/src/main/java/org/wamblee/support/persistence/JpaTester.java
b/test/enterprise/src/main/java/org/wamblee/support/persistence/JpaTester.java
index e74003f126276fc162cfd0085639c873724111cc..26bf6bbc1d75f8c9edb43fafcb5013529c8553ef 100644
(file)
--- a/
test/enterprise/src/main/java/org/wamblee/support/persistence/JpaTester.java
+++ b/
test/enterprise/src/main/java/org/wamblee/support/persistence/JpaTester.java
@@
-117,22
+117,42
@@
public class JpaTester {
}
}
}
}
+ /**
+ * Gets the database.
+ * @return Database.
+ */
public Database getDb() {
return db;
}
public Database getDb() {
return db;
}
+ /**
+ * Gets the datasource.
+ * @return Datasource.
+ */
public DataSource getDataSource() {
return dataSource;
}
public DataSource getDataSource() {
return dataSource;
}
+ /**
+ * Gets the database utilities.
+ * @return Database utilities.
+ */
public DatabaseUtils getDbUtils() {
return dbUtils;
}
public DatabaseUtils getDbUtils() {
return dbUtils;
}
+ /**
+ * Gets the jpa builder.
+ * @return JPA builder.
+ */
public JpaBuilder getJpaBuilder() {
return jpaBuilder;
}
public JpaBuilder getJpaBuilder() {
return jpaBuilder;
}
+ /**
+ * Gets the persistence unit.
+ * @return Persistence unit.
+ */
public PersistenceUnitDescription getPersistenceUnit() {
return persistenceUnit;
}
public PersistenceUnitDescription getPersistenceUnit() {
return persistenceUnit;
}