comparison artifact-database/src/main/resources/sql/org-h2-driver.properties @ 179:644fd11ddd9f

Added code to set attribute of a collection item. artifacts/trunk@1405 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Sun, 06 Mar 2011 10:55:37 +0000
parents 535e4ea2ef9b
children 38fbbeffe8fe
comparison
equal deleted inserted replaced
178:535e4ea2ef9b 179:644fd11ddd9f
52 SELECT ci.attribute FROM collections_items ci \ 52 SELECT ci.attribute FROM collections_items ci \
53 INNER JOIN collection c ON ci.collection_id = c.id \ 53 INNER JOIN collection c ON ci.collection_id = c.id \
54 INNER JOIN attributes a ON ci.artifact_id = a.id \ 54 INNER JOIN attributes a ON ci.artifact_id = a.id \
55 WHERE c.gid = ? AND a.gid = ? 55 WHERE c.gid = ? AND a.gid = ?
56 56
57 collection.item.set.attribute= \
58 UPDATE collections_items SET attribute = ? WHERE id IN ( \
59 SELECT ci.id FROM collections_items ci \
60 INNER JOIN collection c ON ci.collection_id = c.id \
61 INNER JOIN attributes a ON ci.artifact_id = a.id \
62 WHERE c.gid = ? AND a.gid = ?)
63
57 # COLLECTIONS 64 # COLLECTIONS
65 collections.touch.by.gid =\
66 UPDATE collection SET last_access = CURRENT_TIMESTAMP \
67 WHERE gid = ?
68
58 collections.id.nextval=SELECT NEXTVAL('COLLECTIONS_ID_SEQ') 69 collections.id.nextval=SELECT NEXTVAL('COLLECTIONS_ID_SEQ')
59 70
60 collections.id.by.gid=SELECT id FROM collections WHERE gid = ? 71 collections.id.by.gid=SELECT id FROM collections WHERE gid = ?
61 72
62 delete.collection.items=DELETE FROM collection_items WHERE collection_id = ? 73 delete.collection.items=DELETE FROM collection_items WHERE collection_id = ?

http://dive4elements.wald.intevation.org