Commit 10a127db authored by Richard Bruskiewich's avatar Richard Bruskiewich Committed by Matija Obreza
Browse files

"methodId" field in ad hoc trait table, changed to "metadataId"

parent b43a071c
......@@ -114,7 +114,7 @@ public class GenesysLowlevelRepositoryImpl implements GenesysLowlevelRepository
// Common table elements
createTableSql.append("CREATE TABLE `").append(method.getId())
.append("` (`id` BIGINT NOT NULL AUTO_INCREMENT, `accessionId` BIGINT NOT NULL, `metadataId` INT NOT NULL, ");
.append("` (`id` BIGINT NOT NULL AUTO_INCREMENT, `accessionId` BIGINT NOT NULL, `metadataId` BIGINT NOT NULL, ");
// Value column
createTableSql.append("`").append(method.getFieldName()).append("` ");
......@@ -126,7 +126,7 @@ public class GenesysLowlevelRepositoryImpl implements GenesysLowlevelRepository
// FK metadata
// createTableSql.append(", INDEX `genesys_Metadata_").append(method.getId()).append("` (`Meta_Id` ASC)");
createTableSql.append(", CONSTRAINT `genesys_Metadata_").append(method.getId())
.append("` FOREIGN KEY (`methodId`) REFERENCES `metadata` (`id` ) ON DELETE NO ACTION ON UPDATE NO ACTION");
.append("` FOREIGN KEY (`metadataId`) REFERENCES `metadata` (`id` ) ON DELETE NO ACTION ON UPDATE NO ACTION");
// FK accession
// createTableSql.append(", INDEX `genesys_Accession_idx` (`ALIS_Id` ASC)");
createTableSql.append(", CONSTRAINT `genesys_Accession_").append(method.getId())
......@@ -190,7 +190,7 @@ public class GenesysLowlevelRepositoryImpl implements GenesysLowlevelRepository
}
try {
int inserted2 = jdbcTemplate.update("insert into accessiontrait (metadataId, accessionId, methodId) (select distinct metadataId, accessionId, "
int inserted2 = jdbcTemplate.update("insert into accessiontrait (metadataId , accessionId, methodId) (select distinct metadataId, accessionId, "
+ methodId + " from `" + methodId + "`)");
if (inserted2 == 0) {
LOG.warn("Method " + methodId + " has no entries?");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment