@@ -0,0 +1,1827 @@
+package com.alexrnl.commons.database.sql;%0A%0Aimport java.sql.Connection;%0Aimport java.sql.PreparedStatement;%0Aimport java.sql.ResultSet;%0Aimport java.sql.SQLException;%0Aimport java.util.Map;%0A%0Aimport com.alexrnl.commons.database.Column;%0Aimport com.alexrnl.commons.database.Dummy;%0Aimport com.alexrnl.commons.database.Dummy.DummyColumn;%0Aimport com.alexrnl.commons.database.EntityColumn;%0A%0A/**%0A * DAO for the Dummy entity.%0A * @author Alex%0A */%0Apublic class DummySQLDAO extends SQLDAO%3CDummy%3E %7B%0A%09/** The sample of entity */%0A%09private Dummy%09%09%09%09%09%09%09%09%09%09%09%09%09sample;%0A%09/** Columns of the dummy table */%0A%09private final Map%3C? extends Enum%3C? extends EntityColumn%3E, Column%3E%09columns;%0A%09%0A%09/**%0A%09 * Constructor #1.%3Cbr /%3E%0A%09 * @param connection%0A%09 *        the connection to the SQL database.%0A%09 * @throws SQLException%0A%09 *         if there was an error while initializing the database.%0A%09 */%0A%09public DummySQLDAO (final Connection connection) throws SQLException %7B%0A%09%09super(connection);%0A%09%09columns = getEntitySample().getEntityColumns();%0A%09%7D%0A%09%0A%09@Override%0A%09protected Dummy getEntitySample () %7B%0A%09%09if (sample == null) %7B%0A%09%09%09sample = new Dummy();%0A%09%09%7D%0A%09%09return sample;%0A%09%7D%0A%09%0A%09@Override%0A%09protected Dummy createEntityFromResult (final ResultSet result) throws SQLException %7B%0A%09%09final Dummy newDummy = new Dummy();%0A%09%09newDummy.setId(result.getInt(columns.get(DummyColumn.ID).getName()));%0A%09%09newDummy.setName(result.getString(columns.get(DummyColumn.NAME).getName()));%0A%09%09return newDummy;%0A%09%7D%0A%09%0A%09@Override%0A%09protected void fillInsertStatement (final PreparedStatement statement, final Dummy obj)%0A%09%09%09throws SQLException %7B%0A%09%09statement.setString(1, obj.getName());%0A%09%7D%0A%09%0A%09@Override%0A%09protected void fillUpdateStatement (final PreparedStatement statement, final Dummy obj)%0A%09%09%09throws SQLException %7B%0A%09%09fillInsertStatement(statement, obj);%0A%09%09statement.setInt(columns.size(), obj.getId());%0A%09%7D%0A%7D%0A

Create the SQL DAO for the Dummy entity