Skip to content
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

CriteriaBuilder produces messed up JPQL query #455

Closed
Mobe91 opened this issue Oct 24, 2017 · 0 comments
Closed

CriteriaBuilder produces messed up JPQL query #455

Mobe91 opened this issue Oct 24, 2017 · 0 comments
Assignees
Milestone

Comments

@Mobe91
Copy link
Contributor

Mobe91 commented Oct 24, 2017

Just produced a completely messed up query out of nowhere (query.txt).
Note the SELECT CASE WHEN = ugdp.id.subject.id AND COUNT (*).

The criteria builder code for this part looks like this:

subqueryInitiator.from(UserGroupDataPermission.class, "ugdp")
                .select("CASE WHEN COUNT(*) > 0 THEN true ELSE false END")
                .innerJoinOn(UserGroupAssigned.class, "uga")
                    .on("uga.user.id").eqExpression(userIdExpression)
                    .on("uga.userGroup.id").eqExpression("ugdp.id.subject.id")
                .end()
                .where("ugdp.id.entity").eqExpression(entityExpression)
                .where("ugdp.id.entityId").eqExpression(entityIdExpression)
                .where("ugdp.id.actionName").eq(action)
                .end();

This has a bad taste of concurrency/caching issue since it cannot be reproduced.

Version: 1.2.0-Alpha3-curecomp-10

@beikov beikov added this to the 1.2.0 milestone Oct 31, 2017
Mobe91 pushed a commit to Mobe91/blaze-persistence that referenced this issue Nov 2, 2017
Mobe91 pushed a commit to Mobe91/blaze-persistence that referenced this issue Nov 2, 2017
Mobe91 pushed a commit to Mobe91/blaze-persistence that referenced this issue Nov 2, 2017
beikov pushed a commit that referenced this issue Nov 2, 2017
@beikov beikov closed this as completed Nov 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants