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

Implement new JPQLGrammar for upcoming Jakarta Persistence 3.2 #1885

Closed
5 tasks done
rfelcman opened this issue Jun 1, 2023 · 1 comment
Closed
5 tasks done

Implement new JPQLGrammar for upcoming Jakarta Persistence 3.2 #1885

rfelcman opened this issue Jun 1, 2023 · 1 comment
Assignees

Comments

@rfelcman rfelcman changed the title Implement new JPQLGrammar for upcomming Jakarta Persistence 3.2 Implement new JPQLGrammar for upcoming Jakarta Persistence 3.2 Jun 1, 2023
@rfelcman rfelcman self-assigned this Jun 1, 2023
@rfelcman
Copy link
Contributor Author

rfelcman commented Jun 1, 2023

@rfelcman assigned for JPQL || operator for string concatenation point

rfelcman added a commit that referenced this issue Jul 17, 2023
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 #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 <[email protected]>
rfelcman added a commit that referenced this issue Aug 29, 2023
…1933)

This change contains following changes:

New JPQL String functions LEFT(), RIGHT() for return leftmost, rightmost number of character from string passed as a first function argument
Tests are available in the JPQL parser and JPA JSE test module
EclipseLink issue is described at #1885 and Jakarta Persistence specification request at the jakartaee/persistence#396
This feature is not directly functional on Apache Derby Database and Oracle Database, but for a booth platforms is implemented overridden operator based on SUBSTR(...) SQL function. See org.eclipse.persistence.platform.database.DerbyPlatform#derbyLeftOperator | derbyRightOperator
and
org.eclipse.persistence.platform.database.OraclePlatform#oracleLeft | oracleRight .

LEFT seemed to be in collision with LEFT JOIN and similar, but after code inspection of usage org.eclipse.persistence.jpa.jpql.parser.Expression.LEFT it never happens.
Main meaning if org.eclipse.persistence.jpa.jpql.parser.Expression.LEFT is now as LEFT() function identifier and in some particular cases String constant "LEFT" behind org.eclipse.persistence.jpa.jpql.parser.Expression.LEFT is used to parse JOINs.

Signed-off-by: Radek Felcman <[email protected]>
rfelcman added a commit that referenced this issue Sep 14, 2023
…CAST (#1937)

This change doesn't create anything new as specified operators/functions were already specified as a part of EclipseLink JPQL extensions from 2.4 version.
There is refactoring/movement of affected code related with `org.eclipse.persistence.jpa.jpql.parser.CastExpression`, `org.eclipse.persistence.jpa.jpql.parser.DatabaseType`, `org.eclipse.persistence.jpa.jpql.parser.UnionClause` from `EclipseLink...` classes to default JPQL classes.
Due this movement all specified operators/functions are available from Jakarta Persistence/JPQL Grammar 3.2 and still from EclipseLink JPQL extensions 2.4.

EclipseLink issue is described at #1885 and Jakarta Persistence specification request at the jakartaee/persistence#395 (cast) and jakartaee/persistence#398 (union, intersect, and except)

Signed-off-by: Radek Felcman <[email protected]>
@rfelcman rfelcman closed this as completed Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant