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

UUIDs fail with EclipseLink and Postgres #28368

Open
mswatosh opened this issue May 7, 2024 · 1 comment
Open

UUIDs fail with EclipseLink and Postgres #28368

mswatosh opened this issue May 7, 2024 · 1 comment
Labels

Comments

@mswatosh
Copy link
Member

mswatosh commented May 7, 2024

When creating a query with a UUID, the parameter is set as a VARCHAR instead of a UUID, and is rejected by Postgres.

Here is an example of the failing query:

UUID uuid = p1.id;
List<?> result = em.createQuery("SELECT p FROM PurchaseOrder p WHERE p.id=?1")
                   .setParameter(1, uuid).getResultList();

There is some discussion on how to convert to a UUID in postgres here:
https://stackoverflow.com/questions/12771737/conversion-string-to-uuid-in-postgres-and-java/34652560#34652560

There is a recreate here (see the /uuid endpoint):
https://github.com/mswatosh/persistence-recreates

@Riva-Tholoor-Philip
Copy link
Contributor

See EclipseLink Issue : 2190

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants