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

Use JPA Metamodels for building SQL queries #20

Open
re1 opened this issue Jun 1, 2020 · 0 comments
Open

Use JPA Metamodels for building SQL queries #20

re1 opened this issue Jun 1, 2020 · 0 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@re1
Copy link
Owner

re1 commented Jun 1, 2020

SQL queries are currently using the EntityManager with string-based Java Persistence Query Language (JPQL) queries. It might be a good idea to use the CriteriaQueries in combination with metamodels.

The article Dynamic, typesafe queries in JPA 2.0 by IBM explains this approach in detail.

The generation of metamodels requires an additional dependency, which might not be a problem as Hibernate supports metamodel generation and the WildFly application server includes Hibernate ORM as the default JPA provider.

Alternatively metamodels could also be generated manually.

@re1 re1 added enhancement New feature or request question Further information is requested labels Jun 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant