Query: can't use String parameter on a UUID

I am using a Postgres DB and have a table with a UUID as the ID and I want to pass a given ID via the init:

invSisDs.refresh( ParamsMap.of( "companyUUID", params.get( "companyUUID" ) ) );

and I get the exception
IllegalArgumentException: You have attempted to set a value of type class java.lang.String for parameter custom_companyUUID with expected type of class java.util.UUID from query string
select e from inv$InvSi e where e.sysTaid.rlm.id = :custom_companyUUID

What do I have to do?
Thanks Andreas

Hi Andreas,

does params.get( “companyUUID” ) returns a UUID or a String? - It seems it returns a String, but should return a UUID instance.


Hi Andreas,
Postgres use non string UUID.

public static UUID fromString(String name) from java.util.*

UUID companyUUID = UUID.fromString( "companyUUID");
invSisDs.refresh( ParamsMap.of( "companyUUID", companyUUID  ) );

Thanks Alex, this worked.