-
Notifications
You must be signed in to change notification settings - Fork 174
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
DateTimeParseException reading Instant column with Persistence 3.2 #2191
Comments
In the attachment You can find my test case which is passing. I don't see any bug as it described above.
TestDemographicInfoBug2191.java_ - test Feel free to modify attached test to demonstrate bug and upload there updated version. |
Hi @rfelcman , I have modified the test to demonstrate the bug.
I tried out insertion using a native query as shown below
I haven't explicitly specified the |
Sorry, but You want in this case from EclipseLink to read/convert date/time which is stored in DB VARCHAR in some formatting into java |
@pardhivkrishna you should not be using native query with hard code string values to try to reproduce the bug the error that Jakarta Data tests are seeing. Jakarta Data does not use native query or supply the values as strings. Jakarta Data uses @Entity
public class DemographicInfo {
@Column
public Instant collectedOn;
... Reproduction attempts that hard code string literals into a native query or enforce a particular |
Hello @rfelcman , I have modified the test using entityManager.persist(entity) as told by @njr-11 . Here's the updated version of the test: And I am getting the
|
Describe the bug
When Persistence 3.2 is used to query for an entity that has an attribute of type Instant, it gets a DateTimeParseException.
See test.jakarta.data.jpa.web.DemographicInfo, which has this attribute:
and the following JPQL which read entities of that type:
SELECT o FROM DemographicInfo o WHERE (o.publicDebt BETWEEN ?1 AND ?2) ORDER BY o.publicDebt
The following exception is raised:
Steps to Reproduce
Re-enable test.jakarta.data.jpa.web.DataJPATestServlet.testBigDecimal() and test.jakarta.data.jpa.web.DataJPATestServlet.testBigInteger(), which, despite their names, are also testing Instant. These had to be disabled when switching the server.xml from persistence-3.1 to persistence-3.2.
Expected behavior
Successful retrieval of the entity, as happens with Persistence 3.1.
Diagnostic information:
OpenLiberty Version: latest in development
Affected feature(s) persistence-3.2, which breaks data-1.0
Java Version:
server.xml configuration - refer to test case
The text was updated successfully, but these errors were encountered: