@@ -0,0 +1,2514 @@
+package com.alexrnl.commons.database;%0A%0Aimport java.io.Serializable;%0Aimport java.nio.file.Path;%0A%0Aimport com.alexrnl.commons.utils.object.AutoCompare;%0Aimport com.alexrnl.commons.utils.object.AutoHashCode;%0Aimport com.alexrnl.commons.utils.object.Field;%0A%0A/**%0A * Class holding the data source configuration information.%3Cbr /%3E%0A * @author Alex%0A */%0Apublic class DataSourceConfiguration implements Serializable %7B%0A%09/** Serial version UID */%0A%09private static final long%09serialVersionUID%09= -3772713943627646577L;%0A%09%0A%09/** The URL of the connection */%0A%09private final String%09%09url;%0A%09/** The user name to use */%0A%09private final String%09%09username;%0A%09/** The password associated to the user name */%0A%09private final String%09%09password;%0A%09/** The path to the creation file, which allow (if set) to create the database if it does not exists */%0A%09private final Path%09%09%09creationFile;%0A%0A%09/**%0A%09 * Constructor #1.%3Cbr /%3E%0A%09 * @param url%0A%09 *        the URL of the database.%0A%09 * @param username%0A%09 *        the user name to use.%0A%09 * @param password%0A%09 *        the password associated to the user name.%0A%09 * @param creationFile%0A%09 *        The path to the creation file, which allow (if set) to create the database if it does%0A%09 *        not exists%0A%09 */%0A%09public DataSourceConfiguration (final String url, final String username, final String password, final Path creationFile) %7B%0A%09%09super();%0A%09%09this.url = url;%0A%09%09this.username = username;%0A%09%09this.password = password;%0A%09%09this.creationFile = creationFile;%0A%09%7D%0A%09%0A%09/**%0A%09 * Return the URL.%0A%09 * @return the URL.%0A%09 */%0A%09@Field%0A%09public String getUrl () %7B%0A%09%09return url;%0A%09%7D%0A%09%0A%09/**%0A%09 * Return the attribute user name.%0A%09 * @return the attribute user name.%0A%09 */%0A%09@Field%0A%09public String getUsername () %7B%0A%09%09return username;%0A%09%7D%0A%09%0A%09/**%0A%09 * Return the attribute password.%0A%09 * @return the attribute password.%0A%09 */%0A%09@Field%0A%09public String getPassword () %7B%0A%09%09return password;%0A%09%7D%0A%0A%09/**%0A%09 * Return the attribute creationFile.%0A%09 * @return the attribute creationFile.%0A%09 */%0A%09@Field%0A%09public Path getCreationFile () %7B%0A%09%09return creationFile;%0A%09%7D%0A%0A%09@Override%0A%09public int hashCode () %7B%0A%09%09return AutoHashCode.getInstance().hashCode(this);%0A%09%7D%0A%0A%09@Override%0A%09public boolean equals (final Object obj) %7B%0A%09%09if (!(obj instanceof DataSourceConfiguration)) %7B%0A%09%09%09return false;%0A%09%09%7D%0A%09%09return AutoCompare.getInstance().compare(this, (DataSourceConfiguration) obj);%0A%09%7D%0A%0A%09@Override%0A%09public String toString () %7B%0A%09%09return %22DataSource connection info %5Burl=%22 + url + %22; username=%22 + username%0A%09%09%09%09+ %22; password=%22 + password + %22; creationFile=%22 + creationFile + %22%5D%22;%0A%09%7D%0A%09%0A%09%0A%7D%0A

Add a DataSourceConfiguration class to hold the info required by implementation of factories