Commit 6a1e217f authored by Maxym Borodenko's avatar Maxym Borodenko
Browse files

Logging fixed

parent a9a7f62f
...@@ -86,7 +86,7 @@ public class AsAdminAspect { ...@@ -86,7 +86,7 @@ public class AsAdminAspect {
LOG.warn("Temporary SYS_ADMIN account is being used."); LOG.warn("Temporary SYS_ADMIN account is being used.");
return new PreAuthenticatedAuthenticationToken("SYS_ADMIN", null, Arrays.asList(new SimpleGrantedAuthority(UserRole.ADMINISTRATOR.getAuthority()))); return new PreAuthenticatedAuthenticationToken("SYS_ADMIN", null, Arrays.asList(new SimpleGrantedAuthority(UserRole.ADMINISTRATOR.getAuthority())));
} else { } else {
LOG.warn("Got SYS_ADMIN account: {} with roles=", sysUser, sysUser.getAuthorities()); LOG.warn("Got SYS_ADMIN account: {} with roles={}", sysUser, sysUser.getAuthorities());
SYS_ADMIN = new PreAuthenticatedAuthenticationToken(sysUser, null, sysUser.getAuthorities()); SYS_ADMIN = new PreAuthenticatedAuthenticationToken(sysUser, null, sysUser.getAuthorities());
} }
} }
......
...@@ -85,7 +85,7 @@ public class CreateContentListener extends RunAsAdminListener { ...@@ -85,7 +85,7 @@ public class CreateContentListener extends RunAsAdminListener {
final Resource[] rs = rpr.getResources(resourcePath); final Resource[] rs = rpr.getResources(resourcePath);
for (final Resource r : rs) { for (final Resource r : rs) {
final String slug = r.getFilename().substring(0, r.getFilename().lastIndexOf(".json")); final String slug = r.getFilename().substring(0, r.getFilename().lastIndexOf(".json"));
LOG.info("Using " + r.getFilename() + " for article slug=" + slug); LOG.info("Using {} for article slug={}", r.getFilename(), slug);
final ObjectMapper mapper = new ObjectMapper(); final ObjectMapper mapper = new ObjectMapper();
try (InputStream stream = r.getInputStream()) { try (InputStream stream = r.getInputStream()) {
...@@ -103,14 +103,14 @@ public class CreateContentListener extends RunAsAdminListener { ...@@ -103,14 +103,14 @@ public class CreateContentListener extends RunAsAdminListener {
if (article == null) { if (article == null) {
try { try {
contentService.createGlobalArticle(slug, locale, entry.getValue().get("title").asText(), entry.getValue().get("body").asText(), null, false); contentService.createGlobalArticle(slug, locale, entry.getValue().get("title").asText(), entry.getValue().get("body").asText(), null, false);
LOG.info("Created article for slug: " + slug + " lang=" + locale.getLanguage()); LOG.info("Created article for slug: {} lang={}", slug, locale.getLanguage());
} catch (CRMException e) { } catch (CRMException e) {
LOG.warn("Failed to create global article slug=" + slug + ".", e); LOG.warn("Failed to create global article slug={}.", slug, e);
} }
} }
} }
} catch (JsonParseException e) { } catch (JsonParseException e) {
LOG.error("Could not create global article " + slug + " from " + r.getFilename() + ". JSON is not valid."); LOG.error("Could not create global article {} from {}. JSON is not valid.", slug, r.getFilename());
} }
} }
} }
......
...@@ -177,7 +177,7 @@ public class FirstRunListener extends RunAsAdminListener { ...@@ -177,7 +177,7 @@ public class FirstRunListener extends RunAsAdminListener {
final Resource[] rs = rpr.getResources(resourcePath); final Resource[] rs = rpr.getResources(resourcePath);
for (final Resource r : rs) { for (final Resource r : rs) {
final String instCode = r.getFilename().substring(0, r.getFilename().lastIndexOf(".json")); final String instCode = r.getFilename().substring(0, r.getFilename().lastIndexOf(".json"));
LOG.info("Using " + r.getFilename() + " for instCode=" + instCode); LOG.info("Using {} for instCode={}", r.getFilename(), instCode);
final ObjectMapper mapper = new ObjectMapper(); final ObjectMapper mapper = new ObjectMapper();
try (InputStream stream = r.getInputStream()) { try (InputStream stream = r.getInputStream()) {
...@@ -193,21 +193,21 @@ public class FirstRunListener extends RunAsAdminListener { ...@@ -193,21 +193,21 @@ public class FirstRunListener extends RunAsAdminListener {
try { try {
batch.put(AccessionHeaderJson.fromJson(node), (ObjectNode) node); batch.put(AccessionHeaderJson.fromJson(node), (ObjectNode) node);
} catch (InvalidDOIException e) { } catch (InvalidDOIException e) {
LOG.warn("Invalid DOI found in accession dummy data: " + r.getFilename(), e); LOG.warn("Invalid DOI found in accession dummy data: {}", r.getFilename(), e);
} }
}); });
if (batch.size() > 0) { if (batch.size() > 0) {
LOG.warn("Upserting " + batch.size() + " accession records for " + instCode); LOG.warn("Upserting {} accession records for {}", batch.size(), instCode);
batchService.ensureTaxonomies(institute, batch); batchService.ensureTaxonomies(institute, batch);
batchService.upsertAccessionData(institute, batch); batchService.upsertAccessionData(institute, batch);
genesysService.updateAccessionCount(institute); genesysService.updateAccessionCount(institute);
} }
} catch (JsonParseException e) { } catch (JsonParseException e) {
LOG.error("Could not read dummy data for " + instCode + " from " + r.getFilename() + ". JSON is not valid.", e); LOG.error("Could not read dummy data for {} from {}. JSON is not valid.", instCode, r.getFilename(), e);
} catch (Exception e) { } catch (Exception e) {
LOG.error("Could not create dummy data. " + e.getMessage()); LOG.error("Could not create dummy data. {}", e.getMessage());
} }
} }
} }
......
...@@ -9,7 +9,6 @@ import java.util.Set; ...@@ -9,7 +9,6 @@ import java.util.Set;
import java.util.UUID; import java.util.UUID;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.genesys2.server.model.genesys.AccessionAlias; import org.genesys2.server.model.genesys.AccessionAlias;
import org.genesys2.server.model.genesys.AccessionAlias.AliasType; import org.genesys2.server.model.genesys.AccessionAlias.AliasType;
import org.genesys2.server.model.genesys.AccessionBreeding; import org.genesys2.server.model.genesys.AccessionBreeding;
...@@ -24,6 +23,8 @@ import org.genesys2.server.model.impl.Crop; ...@@ -24,6 +23,8 @@ import org.genesys2.server.model.impl.Crop;
import org.genesys2.server.model.impl.Organization; import org.genesys2.server.model.impl.Organization;
import org.genesys2.server.service.IndexAliasConstants; import org.genesys2.server.service.IndexAliasConstants;
import org.genesys2.util.MCPDUtil; import org.genesys2.util.MCPDUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.annotation.Id; import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.Version; import org.springframework.data.annotation.Version;
import org.springframework.data.elasticsearch.annotations.Document; import org.springframework.data.elasticsearch.annotations.Document;
...@@ -36,7 +37,7 @@ import org.springframework.data.elasticsearch.annotations.FieldType; ...@@ -36,7 +37,7 @@ import org.springframework.data.elasticsearch.annotations.FieldType;
*/ */
@Document(indexName = IndexAliasConstants.INDEX_PASSPORT, type = IndexAliasConstants.PASSPORT_TYPE, refreshInterval = "60s") @Document(indexName = IndexAliasConstants.INDEX_PASSPORT, type = IndexAliasConstants.PASSPORT_TYPE, refreshInterval = "60s")
public class AccessionDetails { public class AccessionDetails {
private static final Logger LOG = Logger.getLogger(AccessionDetails.class); private static final Logger LOG = LoggerFactory.getLogger(AccessionDetails.class);
@Version @Version
private Long version; private Long version;
...@@ -149,7 +150,7 @@ public class AccessionDetails { ...@@ -149,7 +150,7 @@ public class AccessionDetails {
ad.acceUrl = accession.getAcceUrl(); ad.acceUrl = accession.getAcceUrl();
if (ad.taxonomy == null) { if (ad.taxonomy == null) {
LOG.warn("Go check " + ad.id); LOG.warn("Go check {}", ad.id);
} }
return ad; return ad;
......
...@@ -7,9 +7,10 @@ import java.util.List; ...@@ -7,9 +7,10 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import org.apache.log4j.Logger;
import org.genesys2.server.model.genesys.ExperimentTrait; import org.genesys2.server.model.genesys.ExperimentTrait;
import org.genesys2.server.model.genesys.Method; import org.genesys2.server.model.genesys.Method;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.annotation.Id; import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.Version; import org.springframework.data.annotation.Version;
import org.springframework.data.elasticsearch.annotations.Document; import org.springframework.data.elasticsearch.annotations.Document;
...@@ -20,7 +21,7 @@ import org.springframework.data.elasticsearch.annotations.Parent; ...@@ -20,7 +21,7 @@ import org.springframework.data.elasticsearch.annotations.Parent;
@Document(indexName = "genesys", type = "trait", refreshInterval = "-1") @Document(indexName = "genesys", type = "trait", refreshInterval = "-1")
public class AccessionEsTrait { public class AccessionEsTrait {
private static final Logger LOG = Logger.getLogger(AccessionDetails.class); private static final Logger LOG = LoggerFactory.getLogger(AccessionEsTrait.class);
@Id @Id
private Long id; private Long id;
...@@ -81,7 +82,7 @@ public class AccessionEsTrait { ...@@ -81,7 +82,7 @@ public class AccessionEsTrait {
else if (value instanceof BigDecimal) else if (value instanceof BigDecimal)
t.dval.add(((BigDecimal) value).doubleValue()); t.dval.add(((BigDecimal) value).doubleValue());
else else
LOG.warn("Unsupported value type " + value.getClass()); LOG.warn("Unsupported value type {}", value.getClass());
} }
return t; return t;
......
...@@ -5,11 +5,11 @@ import java.lang.reflect.Method; ...@@ -5,11 +5,11 @@ import java.lang.reflect.Method;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import org.apache.commons.logging.Log; import org.slf4j.Logger;
import org.apache.commons.logging.LogFactory; import org.slf4j.LoggerFactory;
public class SelfCopy { public class SelfCopy {
private static Log LOG = LogFactory.getLog(SelfCopy.class); private static final Logger LOG = LoggerFactory.getLogger(SelfCopy.class);
private static Map<Method, Method> gettersSetters = new HashMap<Method, Method>(); private static Map<Method, Method> gettersSetters = new HashMap<Method, Method>();
static { static {
...@@ -28,14 +28,14 @@ public class SelfCopy { ...@@ -28,14 +28,14 @@ public class SelfCopy {
if (isGet) { if (isGet) {
if (LOG.isTraceEnabled()) { if (LOG.isTraceEnabled()) {
LOG.trace("Finding setter for getter " + getter); LOG.trace("Finding setter for getter {}", getter);
} }
try { try {
Method setter = AccessionData.class.getMethod("set" + name, getter.getReturnType()); Method setter = AccessionData.class.getMethod("set" + name, getter.getReturnType());
gettersSetters.put(getter, setter); gettersSetters.put(getter, setter);
LOG.debug("Found setter " + setter); LOG.debug("Found setter {}", setter);
} catch (NoSuchMethodException | SecurityException e) { } catch (NoSuchMethodException | SecurityException e) {
LOG.warn("No setter for " + name); LOG.warn("No setter for {}", name);
} }
} }
} }
......
...@@ -44,11 +44,11 @@ import com.fasterxml.jackson.databind.JsonNode; ...@@ -44,11 +44,11 @@ import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.genesys.blocks.security.model.AclAwareModel; import org.genesys.blocks.security.model.AclAwareModel;
import org.genesys2.server.model.GlobalVersionedAuditedModel; import org.genesys2.server.model.GlobalVersionedAuditedModel;
import org.hibernate.annotations.Type; import org.hibernate.annotations.Type;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Cacheable @Cacheable
@Entity @Entity
...@@ -57,7 +57,8 @@ public class Crop extends GlobalVersionedAuditedModel implements AclAwareModel { ...@@ -57,7 +57,8 @@ public class Crop extends GlobalVersionedAuditedModel implements AclAwareModel {
private static final long serialVersionUID = -2686341831839109257L; private static final long serialVersionUID = -2686341831839109257L;
public static final Log LOG = LogFactory.getLog(Crop.class); public static final Logger LOG = LoggerFactory.getLogger(Crop.class);
/** /**
* Crop short name used as short name in URLs * Crop short name used as short name in URLs
......
...@@ -22,20 +22,20 @@ import javax.persistence.EntityManager; ...@@ -22,20 +22,20 @@ import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext; import javax.persistence.PersistenceContext;
import javax.persistence.Query; import javax.persistence.Query;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.genesys2.server.model.genesys.Method; import org.genesys2.server.model.genesys.Method;
import org.genesys2.server.model.impl.AccessionList; import org.genesys2.server.model.impl.AccessionList;
import org.genesys2.server.service.impl.DirectMysqlQuery; import org.genesys2.server.service.impl.DirectMysqlQuery;
import org.genesys2.server.service.impl.DirectMysqlQuery.MethodResolver; import org.genesys2.server.service.impl.DirectMysqlQuery.MethodResolver;
import org.genesys2.server.service.impl.FilterHandler.AppliedFilters; import org.genesys2.server.service.impl.FilterHandler.AppliedFilters;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@Repository @Repository
public class AccessionListRepositoryCustomImpl implements AccessionListCustomRepository { public class AccessionListRepositoryCustomImpl implements AccessionListCustomRepository {
public static final Log LOG = LogFactory.getLog(AccessionListRepositoryCustomImpl.class); public static final Logger LOG = LoggerFactory.getLogger(AccessionListRepositoryCustomImpl.class);
@PersistenceContext @PersistenceContext
private EntityManager entityManager; private EntityManager entityManager;
...@@ -70,7 +70,7 @@ public class AccessionListRepositoryCustomImpl implements AccessionListCustomRep ...@@ -70,7 +70,7 @@ public class AccessionListRepositoryCustomImpl implements AccessionListCustomRep
q.setParameter(1, list.getId()); q.setParameter(1, list.getId());
if (LOG.isDebugEnabled()) if (LOG.isDebugEnabled())
LOG.debug("Updating list: " + list.getUuid() + " id=" + list.getId()); LOG.debug("Updating list: {} id={}", list.getUuid(), list.getId());
int param = 2; int param = 2;
for (Object pv : directQuery.getParameters()) { for (Object pv : directQuery.getParameters()) {
......
...@@ -96,7 +96,7 @@ public class AccessionRepositoryCustomImpl implements AccessionCustomRepository, ...@@ -96,7 +96,7 @@ public class AccessionRepositoryCustomImpl implements AccessionCustomRepository,
List<Accession> res = em.createQuery(cq).getResultList(); List<Accession> res = em.createQuery(cq).getResultList();
if (LOG.isDebugEnabled()) if (LOG.isDebugEnabled())
LOG.debug("*** Loaded accessions " + res.size() + " of " + acceNumbs.size()); LOG.debug("*** Loaded accessions {} of {}", res.size(), acceNumbs.size());
// Check for duplicate names if institute is using unique acceNumbs // Check for duplicate names if institute is using unique acceNumbs
if (uniqueAcceNumbs) { if (uniqueAcceNumbs) {
......
...@@ -23,12 +23,12 @@ import java.sql.ResultSet; ...@@ -23,12 +23,12 @@ import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.List; import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.genesys2.server.model.genesys.Method; import org.genesys2.server.model.genesys.Method;
import org.genesys2.server.service.impl.DirectMysqlQuery; import org.genesys2.server.service.impl.DirectMysqlQuery;
import org.genesys2.server.service.impl.DirectMysqlQuery.MethodResolver; import org.genesys2.server.service.impl.DirectMysqlQuery.MethodResolver;
import org.genesys2.server.service.impl.FilterHandler.AppliedFilters; import org.genesys2.server.service.impl.FilterHandler.AppliedFilters;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable; import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort;
...@@ -45,7 +45,7 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -45,7 +45,7 @@ import org.springframework.transaction.annotation.Transactional;
@Repository @Repository
public class GenesysLowlevelRepositoryCustomImpl implements GenesysLowlevelRepository { public class GenesysLowlevelRepositoryCustomImpl implements GenesysLowlevelRepository {
public static final Log LOG = LogFactory.getLog(GenesysLowlevelRepositoryCustomImpl.class); public static final Logger LOG = LoggerFactory.getLogger(GenesysLowlevelRepositoryCustomImpl.class);
@Autowired @Autowired
private JdbcTemplate jdbcTemplate; private JdbcTemplate jdbcTemplate;
...@@ -59,12 +59,12 @@ public class GenesysLowlevelRepositoryCustomImpl implements GenesysLowlevelRepos ...@@ -59,12 +59,12 @@ public class GenesysLowlevelRepositoryCustomImpl implements GenesysLowlevelRepos
public void updateFaoInstituteRefs() { public void updateFaoInstituteRefs() {
LOG.info("Updating institute references"); LOG.info("Updating institute references");
int count = this.jdbcTemplate.update("UPDATE `accession` A inner join `faoinstitute` FI on FI.code=A.instCode set A.instituteId=FI.id;"); int count = this.jdbcTemplate.update("UPDATE `accession` A inner join `faoinstitute` FI on FI.code=A.instCode set A.instituteId=FI.id;");
LOG.info("Institute references updated: " + count); LOG.info("Institute references updated: {}", count);
LOG.info("Updating institute accession count"); LOG.info("Updating institute accession count");
count = this.jdbcTemplate count = this.jdbcTemplate
.update("UPDATE faoinstitute FI inner join (select instituteId, count(*) X from accession group by instituteId) A on A.instituteId=FI.id set FI.accessionCount=A.X;"); .update("UPDATE faoinstitute FI inner join (select instituteId, count(*) X from accession group by instituteId) A on A.instituteId=FI.id set FI.accessionCount=A.X;");
LOG.info("Institute accession counts updated: " + count); LOG.info("Institute accession counts updated: {}", count);
} }
// @Override // @Override
...@@ -88,7 +88,7 @@ public class GenesysLowlevelRepositoryCustomImpl implements GenesysLowlevelRepos ...@@ -88,7 +88,7 @@ public class GenesysLowlevelRepositoryCustomImpl implements GenesysLowlevelRepos
LOG.info("Updating country references"); LOG.info("Updating country references");
final int count = this.jdbcTemplate final int count = this.jdbcTemplate
.update("UPDATE `accession` A inner join `country` C on C.code3=A.orgCty set A.orgCtyId=C.id WHERE A.orgCty IS NOT NULL;"); .update("UPDATE `accession` A inner join `country` C on C.code3=A.orgCty set A.orgCtyId=C.id WHERE A.orgCty IS NOT NULL;");
LOG.info("Country references updated: " + count); LOG.info("Country references updated: {}", count);
} }
@Override @Override
...@@ -97,19 +97,19 @@ public class GenesysLowlevelRepositoryCustomImpl implements GenesysLowlevelRepos ...@@ -97,19 +97,19 @@ public class GenesysLowlevelRepositoryCustomImpl implements GenesysLowlevelRepos
public void updateFaoInstituteCountries() { public void updateFaoInstituteCountries() {
LOG.info("Updating country references"); LOG.info("Updating country references");
final int count = this.jdbcTemplate.update("UPDATE `faoinstitute` I inner join `country` C on C.code3=left(I.code, 3) set I.countryId=C.id;"); final int count = this.jdbcTemplate.update("UPDATE `faoinstitute` I inner join `country` C on C.code3=left(I.code, 3) set I.countryId=C.id;");
LOG.info("Country references updated: " + count); LOG.info("Country references updated: {}", count);
} }
@Override @Override
public void ensureMethodTable(final Method method) { public void ensureMethodTable(final Method method) {
LOG.info("Ensuring method table for " + method); LOG.info("Ensuring method table for {}", method);
try { try {
LOG.info("Checking for table with name " + method.getId().toString()); LOG.info("Checking for table with name {}", method.getId().toString());
final DatabaseMetaData databaseMetadata = this.jdbcTemplate.getDataSource().getConnection().getMetaData(); final DatabaseMetaData databaseMetadata = this.jdbcTemplate.getDataSource().getConnection().getMetaData();
final ResultSet matchingTables = databaseMetadata.getTables(null, null, method.getId().toString(), new String[] { "TABLE" }); final ResultSet matchingTables = databaseMetadata.getTables(null, null, method.getId().toString(), new String[] { "TABLE" });
if (matchingTables.next()) { if (matchingTables.next()) {
LOG.info("Found existing table: " + matchingTables.getObject(3)); LOG.info("Found existing table: {}", matchingTables.getObject(3));
throw new RuntimeException("Method data table already exists!"); throw new RuntimeException("Method data table already exists!");
} else { } else {
/* /*
...@@ -145,12 +145,12 @@ public class GenesysLowlevelRepositoryCustomImpl implements GenesysLowlevelRepos ...@@ -145,12 +145,12 @@ public class GenesysLowlevelRepositoryCustomImpl implements GenesysLowlevelRepos
// createTableSql.append(", KEY `").append(method.getFieldName()).append("` (`").append(method.getFieldName()).append("`)"); // createTableSql.append(", KEY `").append(method.getFieldName()).append("` (`").append(method.getFieldName()).append("`)");
createTableSql.append(") ENGINE=InnoDB DEFAULT CHARSET=utf8;"); createTableSql.append(") ENGINE=InnoDB DEFAULT CHARSET=utf8;");
LOG.warn("Creating method table: " + createTableSql.toString()); LOG.warn("Creating method table: {}", createTableSql.toString());
this.jdbcTemplate.execute(createTableSql.toString()); this.jdbcTemplate.execute(createTableSql.toString());
} }
LOG.info("Done"); LOG.info("Done");
} catch (final SQLException e) { } catch (final SQLException e) {
LOG.error(e); LOG.error("Error", e);
} }
} }
...@@ -173,7 +173,7 @@ public class GenesysLowlevelRepositoryCustomImpl implements GenesysLowlevelRepos ...@@ -173,7 +173,7 @@ public class GenesysLowlevelRepositoryCustomImpl implements GenesysLowlevelRepos
final List<Long> methodIds = this.jdbcTemplate.queryForList("select id from method", Long.class); final List<Long> methodIds = this.jdbcTemplate.queryForList("select id from method", Long.class);
for (final long methodId : methodIds) { for (final long methodId : methodIds) {
LOG.info("Updating metadatamethod for methodId=" + methodId); LOG.info("Updating metadatamethod for methodId={}", methodId);
// // Delete stuff without Metadata // // Delete stuff without Metadata
// int deleted = jdbcTemplate.update("delete from `" + methodId + // int deleted = jdbcTemplate.update("delete from `" + methodId +
...@@ -190,12 +190,12 @@ public class GenesysLowlevelRepositoryCustomImpl implements GenesysLowlevelRepos ...@@ -190,12 +190,12 @@ public class GenesysLowlevelRepositoryCustomImpl implements GenesysLowlevelRepos
final int inserted = this.jdbcTemplate.update("insert into metadatamethod (metadataId, methodId) (select distinct metadataId, " + methodId final int inserted = this.jdbcTemplate.update("insert into metadatamethod (metadataId, methodId) (select distinct metadataId, " + methodId
+ " from `" + methodId + "`)"); + " from `" + methodId + "`)");
if (inserted == 0) { if (inserted == 0) {
LOG.warn("Method " + methodId + " has no entries?"); LOG.warn("Method {} has no entries?", methodId);
} else { } else {
LOG.warn("Inserted " + inserted + " method references for metadata for methodId=" + methodId); LOG.warn("Inserted {} method references for metadata for methodId={}", inserted, methodId);
} }
} catch (final BadSqlGrammarException e) { } catch (final BadSqlGrammarException e) {
LOG.warn(e); LOG.warn("BadSqlGrammarException", e);
} }
try { try {
...@@ -203,12 +203,12 @@ public class GenesysLowlevelRepositoryCustomImpl implements GenesysLowlevelRepos ...@@ -203,12 +203,12 @@ public class GenesysLowlevelRepositoryCustomImpl implements GenesysLowlevelRepos
.update("insert into accessiontrait (metadataId , accessionId, methodId) (select distinct metadataId, accessionId, " + methodId .update("insert into accessiontrait (metadataId , accessionId, methodId) (select distinct metadataId, accessionId, " + methodId
+ " from `" + methodId + "`)"); + " from `" + methodId + "`)");
if (inserted2 == 0) { if (inserted2 == 0) {
LOG.warn("Method " + methodId + " has no entries?"); LOG.warn("Method {} has no entries?", methodId);
} else { } else {
LOG.warn("Inserted " + inserted2 + " accession references methodId=" + methodId); LOG.warn("Inserted {} accession references methodId={}", inserted2, methodId);
} }
} catch (final BadSqlGrammarException e) { } catch (final BadSqlGrammarException e) {
LOG.warn(e); LOG.warn("BadSqlGrammarException", e);
} }
} }
} }
......
...@@ -30,8 +30,6 @@ import java.util.Set; ...@@ -30,8 +30,6 @@ import java.util.Set;
import javax.sql.DataSource; import javax.sql.DataSource;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.genesys2.server.model.genesys.AccessionData; import org.genesys2.server.model.genesys.AccessionData;
import org.genesys2.server.model.genesys.AccessionId;