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

Selection by entity ID and related entity attribute is not commutative in Criteria API #178

Closed
ledsoft opened this issue Jun 17, 2023 · 0 comments · Fixed by #179
Closed
Labels

Comments

@ledsoft
Copy link
Contributor

ledsoft commented Jun 17, 2023

The following query returns no results when using Criteria API

final CriteriaQuery<OWLClassD> query = cb.createQuery(OWLClassD.class);
final Root<OWLClassD> root = query.from(OWLClassD.class);
query.select(root).where(
                cb.equal(root.getAttr("owlClassA").getAttr("stringAttribute"), 
                                instance.getOwlClassA().getStringAttribute(), "en"),
                cb.equal(root.getAttr("uri"), instance.getUri()));

and generates an incorrect SPARQL query. When the where condition elements are reversed, the query correctly returns the matching result.

@ledsoft ledsoft added the bug label Jun 17, 2023
ledsoft added a commit that referenced this issue Jun 22, 2023
@ledsoft ledsoft linked a pull request Jun 22, 2023 that will close this issue
@ledsoft ledsoft closed this as completed Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant