QueryDSL sql and UUID type
I am using QueryDSL SQL with PostgresTemplates
and I am trying to include the UUID parameter in a query, but when I execute this query:
UUID uuid = UUID.randomUUID();
QOrganization org = QOrganization.organization;
long count = new SQLQuery(connection, configuration)
.from(org)
.where(org.id.eq(uuid))
.count();
The database complains:
org.postgresql.util.PSQLException: there is no operator does not exist: uuid = character varying
How can I explicitly specify my UUID parameter?
+3
turboDi
source
to share
1 answer
Querydsl SQL currently maps UUID types for PreparedStatements via setString. It looks like Postgres supports setting UUIDs directly through setObject, so some tuning is needed for UUID support in Quyrdsl SQL.
+3
Timo Westkämper
source
to share