openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Reilly <>
Subject cast user defined type
Date Mon, 22 Aug 2016 20:12:48 GMT
Hi all,

I am using OpenJPA 2.4 & Postgresql 9.  I have a custom user defined 
column & would like to cast it using criteriabuilder. The following is 
close to what I want, but not exactly:

critBuilder.function("cast", String.class, root.<String> get("strand")), "+")

This generates the following:

cast(t0.strand) = ?

What I want is closer to this:

cast(t0.strand as varchar) = ?

Any clues would be helpful as to how to properly cast this field.  I 
know about ValueHandler's & FieldStrategy's, but would prefer to avoid 
writing one.


View raw message