-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for startsWith , contains , endsWith for String #29
Comments
That functionality mostly exists, but it's buried in the documentation. You can find it in section "4.2 Functions" of the Query Guide. |
i am not sure how that works , can you provide me with a small sample pls? |
|
yes contains seems to work thanks :) . For startsWith , endWIth i guess there isn't a support since i get caused by: org.jinq.rebased.org.objectweb.asm.tree.analysis.AnalyzerException: Unknown method java/lang/String:endsWith(Ljava/lang/String;)Z encountered Is there any plans for that? or i can do it with JPQL.like() ? (but i don't understand how i use that...) |
The underlying database query language of Hibernate/EclipseLink/JPA doesn't have a function that's equivalent to startsWith() and endsWith(), so they aren't directly supported. If you look at the list of functions that are supported, you can probably construct equivalent functionality using indexOf() and length(). JPQL.like() would also work. You should look up the LIKE function in JPQL or SQL to see what the syntax is. I think it's something like JPQL.like(s, "%th") to see if a string ends in "th". |
Currently only equals seems to be supported, I guess it is not that hard for the above methods to be added
The text was updated successfully, but these errors were encountered: