Mercurial > dive4elements > framework
diff artifact-database/src/main/resources/sql/org-h2-driver.properties @ 167:c9c27aca2f70
Added code to list collections.
artifacts/trunk@1392 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 03 Mar 2011 17:01:04 +0000 |
parents | db0d20440b92 |
children | ac0f8bd97277 |
line wrap: on
line diff
--- a/artifact-database/src/main/resources/sql/org-h2-driver.properties Thu Mar 03 14:49:09 2011 +0000 +++ b/artifact-database/src/main/resources/sql/org-h2-driver.properties Thu Mar 03 17:01:04 2011 +0000 @@ -49,6 +49,15 @@ INSERT INTO collections (id, gid, name, owner_id, creation, last_access, ttl) \ VALUES (?, ?, ?, ?, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, ?) +collections.select.user= \ + SELECT c.gid, c.name, c.creation, u.gid FROM \ + collections c OUTER LEFT JOIN user u ON c.owner_id = u.id \ + WHERE u.gid = ? + +collections.select.all= \ + SELECT c.gid, c.name, c.creation, u.gid FROM \ + collections c OUTER LEFT JOIN user u ON c.owner_id = u.id + users.collections=SELECT collection_id, gid, name FROM collections WHERE owner_id = ? users.collection.ids=SELECT collection_id FROM collections WHERE owner_id = ?