changeset 215:a9c8fa38ba03

Added new collection specific sql statements. artifacts/trunk@1554 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 24 Mar 2011 11:28:26 +0000
parents fc435da7f471
children 2d90d5cfe8f9
files ChangeLog artifact-database/src/main/resources/sql/org-h2-driver.properties artifact-database/src/main/resources/sql/org-postgresql-driver.properties
diffstat 3 files changed, 16 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Mar 23 16:23:52 2011 +0000
+++ b/ChangeLog	Thu Mar 24 11:28:26 2011 +0000
@@ -1,3 +1,10 @@
+2011-03-24  Ingo Weinzierl <ingo@intevation.de>
+
+	* artifact-database/src/main/resources/sql/org-h2-driver.properties,
+	  artifact-database/src/main/resources/sql/org-postgresql-driver.properties:
+	  Added new statement to retrieve a single collection by GID and repaired
+	  a statement in the postgres properties.
+
 2011-03-23  Ingo Weinzierl <ingo@intevation.de>
 
 	* artifacts-common/src/main/java/de/intevation/artifacts/common/utils/ClientProtocolUtils.java:
--- a/artifact-database/src/main/resources/sql/org-h2-driver.properties	Wed Mar 23 16:23:52 2011 +0000
+++ b/artifact-database/src/main/resources/sql/org-h2-driver.properties	Thu Mar 24 11:28:26 2011 +0000
@@ -120,6 +120,10 @@
     SELECT c.gid, c.name, c.creation, u.gid FROM \
     collections c LEFT OUTER JOIN users u ON c.owner_id = u.id
 
+collections.select.by.gid= \
+    SELECT id, name, owner_id, creation, last_access, attribute \
+    FROM collections WHERE gid = ?
+
 users.collections=SELECT collection_id, gid, name FROM collections WHERE owner_id = ?
 users.collection.ids=SELECT collection_id FROM collections WHERE owner_id = ?
 
--- a/artifact-database/src/main/resources/sql/org-postgresql-driver.properties	Wed Mar 23 16:23:52 2011 +0000
+++ b/artifact-database/src/main/resources/sql/org-postgresql-driver.properties	Thu Mar 24 11:28:26 2011 +0000
@@ -29,7 +29,7 @@
 
 users.id.nextval=SELECT NEXTVAL('USERS_ID_SEQ')
 
-users.insert=INSERT INTO users (id, gid, name, role) VALUES (?, ?, ?, ?)
+users.insert=INSERT INTO users (id, gid, name, role) VALUES (?, ?::uuid, ?, ?)
 
 users.select.id.by.gid=SELECT id FROM users WHERE gid = ?::uuid
 users.select.gid=SELECT id, name, role FROM users WHERE gid = ?::uuid
@@ -119,6 +119,10 @@
     SELECT c.gid, c.name, c.creation, u.gid FROM \
     collections c LEFT OUTER JOIN users u ON c.owner_id = u.id
 
+collections.select.by.gid= \
+    SELECT id, name, owner_id, creation, last_access, attribute \
+    FROM collections WHERE gid = ?
+
 users.collections=SELECT collection_id, gid, name FROM collections WHERE owner_id = ?
 users.collection.ids=SELECT collection_id FROM collections WHERE owner_id = ?
 

http://dive4elements.wald.intevation.org