0

DataBase: R2DBC Postgres

I have a column model_id at table with type: uuid[].

create table t_job
(
    id             uuid      default gen_random_uuid() not null
        primary key,
    model_id       uuid[]                              not null,
// -- ANOTHER COLUMN -- //
);

I need compare values from column model_id with Set<UUID>

    @Query("""
            SELECT case
                WHEN COUNT(j) >= 1
                    THEN true
                    ELSE false
                END
            FROM t_job AS j
                WHERE j.model_id IN :modelIdSet
                AND j.state = 'done'
                AND j.output_format = 'COLLISION'
""")
    Mono<Boolean> isCollisionJobDoneBySeveralModelsId(String modelIdSet);

OUTPUT: "debugMessage": "executeMany; bad SQL grammar [ SELECT case\n WHEN COUNT(j) >= 1\n THEN true\n ELSE false\n END\n FROM runner_processing_service.t_job AS j\n WHERE j.model_id IN :modelIdSet\n AND j.state = 'done'\n AND j.output_format = 'COLLISION'\n]; nested exception is io.r2dbc.postgresql.ExceptionFactory$PostgresqlBadGrammarException: [42601] syntax error at or near "$1""

How correct insert and compare values from uuid[] column with Set<UUID>

I try convert Set to String type and give that string to repository`s method, but it is not work to.

This query is work correct from console enter image description here

0 Answers0