Logging!!
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
|
||||
package danielcortes.xyz.models.caja;
|
||||
|
||||
import danielcortes.xyz.data.Configuration;
|
||||
import danielcortes.xyz.data.ConnectionHolder;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
@@ -31,8 +32,12 @@ import java.sql.SQLException;
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
public abstract class CajaDAO {
|
||||
private static final Logger LOGGER = Logger.getLogger(Configuration.class.getName());
|
||||
|
||||
protected ConnectionHolder connectionHolder;
|
||||
|
||||
public abstract List<Caja> findAll();
|
||||
@@ -47,13 +52,15 @@ public abstract class CajaDAO {
|
||||
|
||||
public abstract void createCajasForMonth(LocalDate month);
|
||||
|
||||
protected List<Caja> cajasFromResultSet(ResultSet rs) throws SQLException {
|
||||
List<Caja> cajasFromResultSet(ResultSet rs) throws SQLException {
|
||||
List<Caja> cajaList = new ArrayList<>();
|
||||
while (rs.next()) {
|
||||
Caja caja = new Caja();
|
||||
caja.setId(rs.getInt("id"));
|
||||
caja.setFecha(LocalDate.parse(rs.getString("fecha")));
|
||||
cajaList.add(caja);
|
||||
|
||||
LOGGER.log(Level.FINER, "Se a creo: {0}", caja);
|
||||
}
|
||||
return cajaList;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user