Se elimino el sistema de logging de java
Planeo hacerlo nuevamente con una libreria
This commit is contained in:
@@ -35,13 +35,8 @@ import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
public class SQLiteDocumentosDAO implements DocumentosDAO {
|
||||
|
||||
private static final Logger LOGGER = Logger.getLogger(SQLiteDocumentosDAO.class.getName());
|
||||
|
||||
private ConnectionHolder connectionHolder;
|
||||
|
||||
public SQLiteDocumentosDAO() {
|
||||
@@ -55,8 +50,6 @@ public class SQLiteDocumentosDAO implements DocumentosDAO {
|
||||
try (Connection conn = connectionHolder.getConnection()) {
|
||||
try (PreparedStatement ps = conn.prepareStatement(query)) {
|
||||
try (ResultSet rs = ps.executeQuery()) {
|
||||
LOGGER.log(Level.FINE, "QUERY: {0}", query);
|
||||
|
||||
while (rs.next()) {
|
||||
//Confio en que la base de datos mapeo correctamente la caja_id
|
||||
@SuppressWarnings("OptionalGetWithoutIsPresent")
|
||||
@@ -74,7 +67,6 @@ public class SQLiteDocumentosDAO implements DocumentosDAO {
|
||||
}
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
LOGGER.log(Level.SEVERE, e.toString(), e);
|
||||
}
|
||||
return documentosList;
|
||||
}
|
||||
@@ -88,8 +80,6 @@ public class SQLiteDocumentosDAO implements DocumentosDAO {
|
||||
try (PreparedStatement ps = conn.prepareStatement(query)) {
|
||||
ps.setInt(1, id);
|
||||
try (ResultSet rs = ps.executeQuery()) {
|
||||
LOGGER.log(Level.FINE, "QUERY: {0} | values: {1}", new Object[]{query, id});
|
||||
|
||||
if (rs.next()) {
|
||||
//Confio en que la base de datos mapeo correctamente la caja_id
|
||||
@SuppressWarnings("OptionalGetWithoutIsPresent")
|
||||
@@ -105,7 +95,6 @@ public class SQLiteDocumentosDAO implements DocumentosDAO {
|
||||
}
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
LOGGER.log(Level.SEVERE, e.toString(), e);
|
||||
}
|
||||
return Optional.ofNullable(documentos);
|
||||
}
|
||||
@@ -123,8 +112,6 @@ public class SQLiteDocumentosDAO implements DocumentosDAO {
|
||||
try (PreparedStatement ps = conn.prepareStatement(query)) {
|
||||
ps.setInt(1, caja.getId());
|
||||
try (ResultSet rs = ps.executeQuery()) {
|
||||
LOGGER.log(Level.FINE, "QUERY: {0} | values: {1}", new Object[]{query, caja.getId()});
|
||||
|
||||
if (rs.next()) {
|
||||
documentos = new Documentos();
|
||||
documentos.setCaja(caja);
|
||||
@@ -136,7 +123,6 @@ public class SQLiteDocumentosDAO implements DocumentosDAO {
|
||||
}
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
LOGGER.log(Level.SEVERE, e.toString(), e);
|
||||
}
|
||||
return Optional.ofNullable(documentos);
|
||||
}
|
||||
@@ -159,7 +145,6 @@ public class SQLiteDocumentosDAO implements DocumentosDAO {
|
||||
}
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
LOGGER.log(Level.SEVERE, e.toString(), e);
|
||||
}
|
||||
return total;
|
||||
}
|
||||
@@ -184,7 +169,6 @@ public class SQLiteDocumentosDAO implements DocumentosDAO {
|
||||
}
|
||||
|
||||
} catch (SQLException e) {
|
||||
LOGGER.log(Level.SEVERE, e.toString(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -203,7 +187,6 @@ public class SQLiteDocumentosDAO implements DocumentosDAO {
|
||||
}
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
LOGGER.log(Level.SEVERE, e.toString(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -220,7 +203,6 @@ public class SQLiteDocumentosDAO implements DocumentosDAO {
|
||||
ps.executeUpdate();
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
LOGGER.log(Level.SEVERE, e.toString(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,7 +214,6 @@ public class SQLiteDocumentosDAO implements DocumentosDAO {
|
||||
ps.setInt(1, documentos.getId());
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
LOGGER.log(Level.SEVERE, e.toString(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user