HHH-10746 Introduce query settings property parse_java_constant #1693

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@tedliang

Introduce query settings property hibernate.query.parse_java_constant which indicates whether or not parse JAVA constant for HQL query.

See HHH-10746

@vladmihalcea
Member
vladmihalcea commented Dec 13, 2016 edited

Thanks for your Pull Request. I don't think that a SessionFactory-level configuration is the best way to handle this issue. A Query Hint is usually a much better approach.

However, we should address the root cause of the issue here instead of bypassing the verification.

Let's see what @sebersole, @gbadner, @Naros or @dreab8 have to say about it.

@vladmihalcea
Member

I added a Pull Request with a fix that doesn't require any configuration and filters out aliases and other expressions that don't follow the Java Naming conventions for a constant expression.

I'm going to close this issue if my fix is validated.

@vladmihalcea
Member

After a peer review with @dreab8, I'm going to reuse your config so that we disable the auto-check if the user decides so.

@vladmihalcea
Member

I fixed it by skipping the aliases. Check out this commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment