-
Notifications
You must be signed in to change notification settings - Fork 582
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
UUID not working as GeneratedValue Id in some cases #24925
Comments
Any outlook on this issue, seems a pretty fundamental one? |
Created an EclipseLink issue to bring the fix in EclipseLink. Issue #2086 |
Since the problem has been accepted and fixed in EclipseLink, I've added |
Working on bringing the changes in EclipseLink to Open Liberty |
As PR# 27872 is merged , we are closing this issue |
Good work fixing the bug. We should keep this issue open until the Jakarta Data tests that discovered it are re-enabled. I created pull #27892 for that. |
Describe the bug
Jakarta Persistence 3.1 added the ability to have a UUID be the id and to also be generated. In some cases such as the following, where
strategy = GenerationType.UUID
or strategy is omitted (defaulting to AUTO), an IllegalArgumentException is being raised when trying to save an entity for the first time (when it starts out without an id, needing it generated).Steps to Reproduce
Using the latest Open Liberty code, update the following test classes to switch
Long
andlong
andSEQUENCE
toUUID
:https://github.com/OpenLiberty/open-liberty/blob/integration/dev/io.openliberty.data.internal_fat_jpa/test-applications/DataJPATestApp/src/test/jakarta/data/jpa/web/Order.java
https://github.com/OpenLiberty/open-liberty/tree/integration/dev/io.openliberty.data.internal_fat_jpa/test-applications/DataJPATestApp/src/test/jakarta/data/jpa/web
Then run the following test bucket:
./gradlew io.openliberty.data.internal_fat_jpa:buildandrun
A single failure is reported, from DataJPATestServlet.testGeneratedKey, which reports the aforementioned IllegalArgumentException as the cause.
Expected behavior
It should be possible to save/merge the entity without the id value, and the UUID value should be generated automatically.
Diagnostic information:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: