Querying a property of a Path created by the treat method causes an Exception to be thrown. Here’s an example of a Criteria Query that triggers the problem:
Path<LocalTerm> asLocalTerm = cb.treat( root.get( "term" ), LocalTerm.class );
criteria.select( root ).where( cb.equal( asLocalTerm.get( "property" ), value ) );
And here’s the stack trace:
The issue appears to be caused by the copy method of the treatedPath.get("property") object: here, the left-hand side, which is the {{treat}}ed path, causes another copy of the property to be triggered while the first one was still being processed and not registered. |