[PATCH] issue1415: Corrected update query and parameter setting
Wald Commits
scm-commit at wald.intevation.org
Wed Aug 7 15:54:13 CEST 2013
# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1375884245 -7200
# Node ID 5077fc1ace1cb72fbdb10c8e31fae231cb2d99b9
# Parent 10646f31efec538bf1e1f84e7c0e14ae01dc1736
issue1415: Corrected update query and parameter setting.
diff -r 10646f31efec -r 5077fc1ace1c artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/Datacage.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/Datacage.java Wed Aug 07 14:05:07 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/Datacage.java Wed Aug 07 16:04:05 2013 +0200
@@ -896,8 +896,8 @@
@Override
public boolean doIt() throws SQLException {
prepareStatement(SQL_UPDATE_ARTIFACT_STATE);
- stmnt.setInt(1, artifactId);
- stmnt.setString(2, artifact.getCurrentStateId());
+ stmnt.setString(1, artifact.getCurrentStateId());
+ stmnt.setInt(2, artifactId);
stmnt.execute();
conn.commit();
return true;
diff -r 10646f31efec -r 5077fc1ace1c artifacts/src/main/resources/datacage-sql/org-h2-driver.properties
--- a/artifacts/src/main/resources/datacage-sql/org-h2-driver.properties Wed Aug 07 14:05:07 2013 +0200
+++ b/artifacts/src/main/resources/datacage-sql/org-h2-driver.properties Wed Aug 07 16:04:05 2013 +0200
@@ -17,7 +17,7 @@
insert.out = INSERT INTO outs (id, artifact_id, name, description, out_type) VALUES (?, ?, ?, ?, ?)
facet.id.nextval = SELECT NEXTVAL('FACETS_ID_SEQ')
insert.facet = INSERT INTO facets (id, out_id, name, num, state, description) VALUES (?, ?, ?, ?, ?, ?)
-update.artifact.state = UPDATE artifacts SET state = ? WHERE gid = ?
+update.artifact.state = UPDATE artifacts SET state = ? WHERE id = ?
update.collection.name = UPDATE collections SET name = ? WHERE gid = ?
delete.artifact.from.collection = DELETE FROM collection_items WHERE collection_id = ? AND artifact_id = ?
More information about the Dive4elements-commits
mailing list