Skip to content

Could not parse expression #1696

Answered by beikov
RustamSultansoy asked this question in Q&A
Discussion options

You must be logged in to vote

Hi. Usually, this is modeled by registering a custom function i.e. any_int and using it in your expressions like 16=any_int(someArray).
You can read more about custom functions and how to register them in the documentation. It will roughly look like this:

public class AnyIntFunction implements JpqlFunction {

    @Override
    public boolean hasArguments() {
        return true;                            
    }

    @Override
    public boolean hasParenthesesIfNoArguments() {
        return true;                            
    }

    @Override
    public Class<?> getReturnType(Class<?> firstArgumentType) {
        return firstArgumentType;               
    }

    @Override
    public v…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@RustamSultansoy
Comment options

Answer selected by RustamSultansoy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants