-
Notifications
You must be signed in to change notification settings - Fork 34
Replace JDQL with JCQL #1315
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
Replace JDQL with JCQL #1315
Changes from all commits
25bb9e7
d10ee86
8fd93c7
3aae4cf
a0f6da0
21800fb
046634e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| /* | ||
| * Copyright (c) 2022,2025 Contributors to the Eclipse Foundation | ||
| * Copyright (c) 2022,2026 Contributors to the Eclipse Foundation | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
|
|
@@ -30,16 +30,17 @@ | |
|
|
||
| /** | ||
| * <p>Annotates a repository method as a query method, specifying a query | ||
| * written in Jakarta Data Query Language (JDQL) or in Jakarta Persistence | ||
| * Query Language (JPQL). A Jakarta Data provider is not required to support | ||
| * written in Jakarta Common Query Language (JCQL) or in Jakarta Persistence | ||
| * Query Language (JPQL). JCQL and JPQL are defined by the Jakarta Query | ||
| * specification. A Jakarta Data provider is not required to support | ||
| * the complete JPQL language, which targets relational data stores. However, | ||
| * a given provider might offer features of JPQL which go beyond the subset | ||
| * required by JDQL, or might even offer vendor-specific extensions to JDQL | ||
| * required by JCQL, or might even offer vendor-specific extensions to JCQL | ||
otaviojava marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| * which target particular capabilities of the target data store technology. | ||
| * Such extensions come with no guarantee of portability between providers, | ||
| * nor between databases.</p> | ||
| * | ||
| * <p>The required {@link #value} member specifies the JDQL or JPQL query as | ||
| * <p>The required {@link #value} member specifies the JCQL or JPQL query as | ||
| * a string.</p> | ||
| * | ||
| * <p>For {@code select} statements, the return type of the query method must | ||
|
|
@@ -72,14 +73,14 @@ | |
| * </li> | ||
| * </ul> | ||
| * | ||
| * <p>Compared to SQL, JDQL allows an abbreviated syntax for {@code select} | ||
| * <p>Compared to SQL, JCQL allows an abbreviated syntax for {@code select} | ||
| * statements:</p> | ||
| * <ul> | ||
| * <li>The {@code from} clause is optional in JDQL. When it is missing, the | ||
| * <li>The {@code from} clause is optional in JCQL. When it is missing, the | ||
| * queried entity is determined by the return type of the repository | ||
| * method, or, if the return type is not an entity type, by the primary | ||
| * entity type of the repository.</li> | ||
| * <li>The {@code select} clause is optional in both JDQL and JPQL. When it | ||
| * <li>The {@code select} clause is optional in both JCQL and JPQL. When it | ||
| * is missing, the query returns the queried entity.</li> | ||
| * </ul> | ||
| * | ||
|
|
@@ -119,11 +120,11 @@ | |
| * @Repository | ||
| * public interface People extends CrudRepository<Person, Long> { | ||
| * | ||
| * // JDQL with positional parameters | ||
| * // JCQL with positional parameters | ||
| * @Query("where firstName = ?1 and lastName = ?2") | ||
| * List<Person> byName(String first, String last); | ||
| * | ||
| * // JDQL with a named parameter | ||
| * // JCQL with a named parameter | ||
| * @Query("where firstName || ' ' || lastName like :pattern") | ||
| * List<Person> byName(String pattern); | ||
| * | ||
|
|
@@ -177,7 +178,7 @@ | |
|
|
||
| /** | ||
| * <p>Specifies the query executed by the annotated repository method, | ||
| * in JDQL or JPQL.</p> | ||
| * in JCQL or JPQL.</p> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @njr-11 shall we use Jakarta Query here? I mean, on this case it will run any of the languages of the query spec.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If Jakarta Query adds additional language levels, we might or might not be able to support them in Jakarta Data. We would want to assess each on a case by case basis.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ahhh ok, good point. |
||
| * | ||
| * <p>If the annotated repository method accepts other forms of sorting | ||
| * (such as a parameter of type {@link Sort}), it is the responsibility of | ||
|
|
||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.