forked from eclipse-ee4j/eclipselink
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New JPQL 3.2 and
||
as a String concat operator (eclipse-ee4j#1903)
This commit contains following changes: New JPQL Grammar 3.2 (version matches upcoming Jakarta Persistence 3.2) and EclipseLink JPQL Grammar 4.1 New JPQL String expression category with related classes (like arithmetic expression) New JPQL String operator || for string concatenation like JPQL CONCAT(....) function Tests are available in JPQL parser and JPA JSE test module EclipseLink issue is described at Implement new JPQLGrammar for upcoming Jakarta Persistence 3.2 eclipse-ee4j#1885 and JPA specification request at the JPQL || operator for string concatenation jakartaee/persistence#397 || operator is handled at JPQL level, but translated into SQL function CONCAT(...) as not every database supports || or is mentioned as OR logical operator (MySQL). Signed-off-by: Radek Felcman <radek.felcman@oracle.com>
- Loading branch information
Showing
51 changed files
with
1,914 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
....persistence.core/src/main/java/org/eclipse/persistence/expressions/ExpressionString.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright (c) 2023 Oracle and/or its affiliates. All rights reserved. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0, | ||
* or the Eclipse Distribution License v. 1.0 which is available at | ||
* http://www.eclipse.org/org/documents/edl-v10.php. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause | ||
*/ | ||
|
||
// Contributors: | ||
// Oracle - initial API and implementation | ||
// 06/02/2023: Radek Felcman | ||
// - Issue 1885: Implement new JPQLGrammar for upcoming Jakarta Persistence 3.2 | ||
package org.eclipse.persistence.expressions; | ||
|
||
/** | ||
* <p> | ||
* <b>Purpose</b>: This class contains String operators.</p> | ||
* <p>Example: | ||
* <blockquote><pre> | ||
* ExpressionBuilder builder = new ExpressionBuilder(); | ||
* Expression stringResult = ExpressionString.concatPipes("abcd", "xyz"); | ||
* session.readAllObjects(Company.class, stringResult); | ||
* </pre></blockquote> | ||
*/ | ||
public final class ExpressionString { | ||
|
||
private ExpressionString() { | ||
} | ||
|
||
/** | ||
* PUBLIC: | ||
* Return a new expression that applies the function to the given expression. | ||
*/ | ||
public static Expression concatPipes(Expression right, Object left) { | ||
ExpressionOperator anOperator = Expression.getOperator(ExpressionOperator.ConcatPipes); | ||
return anOperator.expressionFor(right, left); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.