Mercurial > dive4elements > river
changeset 1019:aff2a0a29aa3
Datacage: use more compatible casts to UUIDs
flys-artifacts/trunk@2465 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 04 Aug 2011 15:32:10 +0000 |
parents | d42fa223be48 |
children | a776afdf1ec5 |
files | flys-artifacts/ChangeLog flys-artifacts/doc/conf/meta-data-user.xml |
diffstat | 2 files changed, 7 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog Thu Aug 04 15:05:02 2011 +0000 +++ b/flys-artifacts/ChangeLog Thu Aug 04 15:32:10 2011 +0000 @@ -1,3 +1,8 @@ +2011-08-04 Sascha L. Teichmann <sascha.teichmann@intevation.de> + + * doc/conf/meta-data-user.xml: Use 'CAST(x AS uuid)' instead of 'x::uuid' + to be more compatible. + 2011-08-04 Sascha L. Teichmann <sascha.teichmann@intevation.de> * src/main/java/de/intevation/flys/artifacts/datacage/Recommendations.java:
--- a/flys-artifacts/doc/conf/meta-data-user.xml Thu Aug 04 15:05:02 2011 +0000 +++ b/flys-artifacts/doc/conf/meta-data-user.xml Thu Aug 04 15:32:10 2011 +0000 @@ -7,7 +7,7 @@ </dc:comment> <dc:if test="dc:contains($parameters, 'user-id')"> <dc:context connection="user"> - <dc:statement>SELECT id as user_id FROM users WHERE gid = ${user-id}::uuid</dc:statement> + <dc:statement>SELECT id as user_id FROM users WHERE gid = CAST(${user-id} AS uuid)</dc:statement> <dc:elements> <dc:context> <dc:statement>SELECT id AS collection_id FROM collections WHERE user_id = ${user_id}</dc:statement> @@ -15,7 +15,7 @@ <dc:context> <dc:statement>SELECT a.id AS a_id, a.state AS a_state, a.gid as a_gid FROM collection_items ci JOIN artifacts a ON ci.artifact_id = a.id - WHERE collection_id = ${collection_id} AND a.state = ${current-state-id} AND a.gid <> ${artifact-id}::uuid + WHERE collection_id = ${collection_id} AND a.state = ${current-state-id} AND a.gid <> CAST(${artifact-id} AS uuid) AND EXISTS (SELECT id FROM artifact_data WHERE artifact_id = a.id AND k = 'river' AND v = ${river}) </dc:statement> <dc:comment> --- TODO: We only need the 'master' artifacts! --- </dc:comment>