Mercurial > dive4elements > framework
diff artifact-database/src/main/java/de/intevation/artifactdatabase/Backend.java @ 320:b46c5b13ac94
Extract the collection and artifact creation times when doing the initial, too.
artifacts/trunk@2482 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Wed, 10 Aug 2011 14:18:33 +0000 |
parents | 2ed77f7e1bab |
children | 542caebea773 |
line wrap: on
line diff
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/Backend.java Mon Aug 08 13:06:05 2011 +0000 +++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/Backend.java Wed Aug 10 14:18:33 2011 +0000 @@ -1760,11 +1760,15 @@ prepareStatement(SQL_ALL_ARTIFACTS); result = stmnt.executeQuery(); while (result.next()) { - String userId = result.getString(1); - String collectionId = result.getString(2); - String collectionName = result.getString(3); - String artifactId = result.getString(4); - String factoryName = result.getString(5); + String userId = result.getString("u_gid"); + String collectionId = result.getString("c_gid"); + String collectionName = result.getString("c_name"); + String artifactId = result.getString("a_gid"); + String factoryName = result.getString("factory"); + Date collectionCreated = + new Date(result.getTimestamp("c_creation").getTime()); + Date artifactCreated = + new Date(result.getTimestamp("a_creation").getTime()); Artifact artifact = alreadyLoaded.get(artifactId); @@ -1772,7 +1776,8 @@ alc.artifactLoaded( userId, collectionId, collectionName, - artifactId, artifact); + collectionCreated, + artifactId, artifactCreated, artifact); continue; } @@ -1784,15 +1789,15 @@ continue; } - byte [] bytes = result.getBytes(6); + byte [] bytes = result.getBytes("data"); artifact = factory.getSerializer().fromBytes(bytes); if (artifact != null) { alc.artifactLoaded( userId, - collectionId, collectionName, - artifactId, artifact); + collectionId, collectionName, collectionCreated, + artifactId, artifactCreated, artifact); } alreadyLoaded.put(artifactId, artifact);