Skip to content

Commit

Permalink
OK-591 Cleanup, use logger
Browse files Browse the repository at this point in the history
  • Loading branch information
msiukola committed Oct 3, 2024
1 parent 0872028 commit 91a5227
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ public SiirtotiedostoProsessi(
}

public SiirtotiedostoProsessi(Object[] result) {
System.out.println("Parsitaan prosessi");
for (int i = 0; i < result.length; i++) {
System.out.println(result[i]);
}
this.executionUuid = (String) result[0];
this.windowStart = ((Timestamp) result[1]).toInstant().atOffset(ZoneOffset.UTC);
this.windowEnd = ((Timestamp) result[2]).toInstant().atOffset(ZoneOffset.UTC);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
package fi.vm.sade.service.valintaperusteet.ovara.ajastus.impl;

import fi.vm.sade.service.valintaperusteet.dao.AbstractJpaDAOImpl;
import fi.vm.sade.service.valintaperusteet.ovara.ajastus.SiirtotiedostoAjastusService;
import fi.vm.sade.service.valintaperusteet.ovara.ajastus.SiirtotiedostoProsessi;
import fi.vm.sade.service.valintaperusteet.ovara.ajastus.SiirtotiedostoProsessiRepository;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import javax.transaction.Transactional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

Expand All @@ -15,8 +18,10 @@
public class SiirtotiedostoProsessiRepositoryImpl
extends AbstractJpaDAOImpl<SiirtotiedostoProsessi, Long>
implements SiirtotiedostoProsessiRepository {
@PersistenceContext private EntityManager entityManager;

private static final Logger logger = LoggerFactory.getLogger(SiirtotiedostoAjastusService.class);

@PersistenceContext private EntityManager entityManager;
private final JdbcTemplate jdbcTemplate;

public SiirtotiedostoProsessiRepositoryImpl(JdbcTemplate jdbcTemplate) {
Expand All @@ -35,7 +40,7 @@ public SiirtotiedostoProsessi findLatestSuccessful() {

@Override
public void persist(SiirtotiedostoProsessi sp) {
System.out.println("Persisting: " + sp);
logger.info("Persisting: {}", sp);
String infoStr = sp.getInfo() != null ? sp.getInfo() : "{}";
this.jdbcTemplate.update(
"insert into siirtotiedosto (execution_uuid, window_start, window_end, run_start, run_end, info, success, error_message) "
Expand Down

0 comments on commit 91a5227

Please sign in to comment.