My application uses JPA to access the backend database.
I have a Java class mapped to a table. The class has a row field (called status), which consists of a series of "0" and "1". I need to select multiple records based on the second character of the field. Here is what I can do without using JPA (I use MS SQLServer).
SELECT * FROM Machines where SUBSTRING(status, 2, 1) = '1'
How can I do this using JPA?
source share