return goodsList;
}
@Override
public Goods findEntityById(int id) throws DaoException {
Goods goods = new Goods();
try (DbConnection connection = DbConnectionPool.INSTANCE.getConnection();
PreparedStatement idStatement = connection.prepareStatement(SQL_FIND_BY_ID);
PreparedStatement producerStatement = connection.prepareStatement(SQL_FIND_PRODUCER_BY_ID)) {
idStatement.setInt(1, id);
ResultSet resultSet = idStatement.executeQuery();
if (resultSet.next()) {
fillUpGoodsEntity(resultSet, goods);
producerStatement.setInt(1, goods.getProducer().getUid());
resultSet = producerStatement.executeQuery();
setProducerAddresses(resultSet, goods);
}
} catch (SQLException e) {
log.error("Error during goods searching by id", e);