Reputation: 9574
I have a database column with XML. I am using JPA
(eclipselink) to access it. The database is oracle so I am using oracle.xdb.XMLType and a @Customizer
annotation. It all works great.
Now I need to use the CriteriaBuilder
to create a query using the XML column in the where clause.
Basically I need to recreate this with CriteriaBuilder
(I do have CriteriaBuilder working for non XML columns):
SELECT id, somecolumn, xmlcol FROM sometable WHERE EXTRACTVALUE(xmlcol,'//path/path')='somevalue';
Any idea how to do this?
Thanks.
Upvotes: 0
Views: 595
Reputation: 18379
You should be able to use the JPA CriteriaBuilder function() API to call this function.
If you need to do something more advanced you could use an EclipseLink Expression query, or mix Expressions and Criteria,
Upvotes: 1