INSERT INTO resourcepolicy
(policy_id, resource_type_id, action_id, rptype, eperson_id, resource_id)
SELECT
nextval('resourcepolicy_seq') AS policy_id,
'0' AS resource_type_id,
'4' AS action_id,
'TYPE_WORKFLOW' AS rptype,
wfi.owner AS eperson_id,
b2b.bitstream_id AS dspace_object
FROM workflowitem AS wfi
JOIN item2bundle AS i2b
ON i2b.item_id = wfi.item_id
JOIN bundle2bitstream AS b2b
ON b2b.bundle_id = i2b.bundle_id
JOIN metadatavalue AS mv
ON mv.resource_id = i2b.bundle_id
JOIN metadatafieldregistry as mfr
ON mv.metadata_field_id = mfr.metadata_field_id
JOIN metadataschemaregistry as msr
ON mfr.metadata_schema_id = msr.metadata_schema_id
WHERE
AND mfr.element = 'title'
AND mfr.qualifier IS NULL
AND mv.text_value = 'ORIGINAL'
AND wfi.owner IS NOT NULL
AND (wfi.state = 2 OR wfi.state = 4 OR wfi.state = 6)
AND NOT EXISTS(
SELECT 1 FROM resourcepolicy WHERE resource_type_id = 0 AND action_id = 4 AND resourcepolicy.eperson_id = owner AND resourcepolicy.resource_id = b2b.bitstream_id
);
]; nested exception is org.postgresql.util.PSQLException: ERROR: operator does not exist: integer = uuid
Hint: No operator matches the given name and argument types. You might need to add explicit type casts.
Position: 767
at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:101)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1443)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:388)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:418)
at org.dspace.storage.rdbms.DatabaseUtils.executeSql(DatabaseUtils.java:1092)
... 34 more
Caused by: org.postgresql.util.PSQLException: ERROR: operator does not exist: integer = uuid
Hint: No operator matches the given name and argument types. You might need to add explicit type casts.
Position: 767
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2505)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2241)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:310)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:447)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:368)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:309)
at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:295)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:272)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:267)
at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:194)
at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:194)
at org.springframework.jdbc.core.JdbcTemplate$1ExecuteStatementCallback.doInStatement(JdbcTemplate.java:409)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:376)