y616468159 opened a new issue, #10773:
URL: https://github.com/apache/ignite/issues/10773
### Question:
When I use IgniteCache.get(key) to get the corresponding entity, ignite
throws the following error "Can not set java.time.LocalDateTime field
org.apache.ignite.examples.model.Person.createdTime to java.sql .Timestamp"
### Conditions and usage:
1. In ignite 2.14.0, I use MySQL as the underlying storage;
2. In `CacheJdbcPojoStoreFactory`, I configured the mapping between the
`datetime type` of the database and JDK8's `LocalDateTime`:
`new JdbcTypeField(Types.TIMESTAMP, "created_time", LocalDateTime.class,
"createdTime")`
### Problem analysis:
By default, `CacheJdbcPojoStore` uses
`org.apache.ignite.cache.store.jdbc.JdbcTypesTransformer#getColumnValue` to
parse jdbc's ResultSet.
For the `LocalDateTime` type of JDK8, `java.sql.ResultSet#getObject(int)` is
used to obtain the value of the specified column (here it is read as
`java.sql.Timestamp`). When the object is finally constructed, the type is
inconsistent Causes `sun.reflect.FieldAccessor#set` assignment to fail.
### Repair suggestion:
I want to parse the value of the specified column using
`java.sql.ResultSet#getObject(int, java.lang.Class<T>)`, but I don't have
**Ignite Jira**, how should I submit this change?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]