diff -r fd8c40ff78c3 -r 824d4042c857 src/main/java/de/uapcore/lightpit/DatabaseFacade.java --- a/src/main/java/de/uapcore/lightpit/DatabaseFacade.java Sat May 09 15:19:21 2020 +0200 +++ b/src/main/java/de/uapcore/lightpit/DatabaseFacade.java Sat May 09 17:01:29 2020 +0200 @@ -1,8 +1,8 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * + * * Copyright 2018 Mike Becker. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * @@ -24,10 +24,12 @@ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. - * + * */ package de.uapcore.lightpit; +import de.uapcore.lightpit.dao.DataAccessObjects; +import de.uapcore.lightpit.dao.postgres.PGDataAccessObjects; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -57,6 +59,9 @@ */ private static final int DB_TEST_TIMEOUT = 10; + /** + * Specifies the database dialect. + */ public enum Dialect { Postgres } @@ -64,21 +69,21 @@ /** * The database dialect to use. *
- * May be override by context parameter. + * May be overridden by context parameter. * * @see Constants#CTX_ATTR_DB_DIALECT */ private Dialect dialect = Dialect.Postgres; - + /** * The default schema to test against when validating the connection. - * + *
* May be overridden by context parameter. - * + * * @see Constants#CTX_ATTR_DB_SCHEMA */ private static final String DB_DEFAULT_SCHEMA = "lightpit"; - + /** * The attribute name in the Servlet context under which an instance of this class can be found. */ @@ -86,21 +91,31 @@ private static final String DS_JNDI_NAME = "jdbc/lightpit/app"; private DataSource dataSource; - + private DataAccessObjects dataAccessObjects; + /** * Returns the data source. - * + *
* The Optional returned should never be empty. However, if something goes
* wrong during initialization, the data source might be absent.
* Hence, users of this data source are forced to check the existence.
- *
+ *
* @return a data source
*/
public Optional