wso2 / wso2/testgrid

Use JPA Criteria API instead of writing native queries.

Open
#413 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Priority/Low Severity/Minor Type/Improvement
Dominant language
Java
Stars
60
Forks
78
PR merge metrics
No merged PRs in 30d

Description

Description:
JPQL/Native queries does not provide type safety. It also makes it hard to switch the JPA provider later on. Therefore, writing JPQL is discouraged in favor of Criteria API starting from JPA 2.0.

As part of this, we need to generate the JPA metamodel for Testgrid entities as well. Metamodel allows type-safe referencing of entity parameters.

Affected Product Version:
0.9.0-m10

OS, DB, other environment details and versions:
N/A
Steps to reproduce:
N/A

Related Issues:
N/A

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files or tests. Start by locating the Testgrid entities and existing JPQL or native queries, then review how JPA Criteria API and metamodel generation fit the project. Done means the relevant queries use Criteria API and a metamodel is generated for the Testgrid entities.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, database
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.