my2iu / Jinq

LINQ-style queries for Java 8
Other
659 stars 71 forks source link

Compare int, datetime, bool to String #90

Closed Flying--Dutchman closed 3 years ago

Flying--Dutchman commented 4 years ago

I'm having trouble comparing different types with a String (searchQuery). As soon as I type .toString().contains(searchQuery), following error appears: Could not analyze lambda code.

Is .toString() not integrated? Any other ways to achieve this?

Flying--Dutchman commented 4 years ago

RTFM....

4.1 Casts and Numeric Promotion

Jinq generally does not generally support casts between different data types. This is due to a limitation of JPQL, which does not support casting data between types in queries. As such, Jinq cannot translate Java code that contains casts into equivalent JPQL queries.