y616468159 opened a new pull request, #10927: URL: https://github.com/apache/ignite/pull/10927
Thank you for submitting the pull request to the Apache Ignite. In order to streamline the review of the contribution we ask you to ensure the following steps have been taken: ### The Contribution Checklist - [ ] There is a single JIRA ticket related to the pull request. - [ ] The web-link to the pull request is attached to the JIRA ticket. - [ ] The JIRA ticket has the _Patch Available_ state. - [ ] The pull request body describes changes that have been made. The description explains _WHAT_ and _WHY_ was made instead of _HOW_. - [ ] The pull request title is treated as the final commit message. The following pattern must be used: `IGNITE-XXXX Change summary` where `XXXX` - number of JIRA issue. - [ ] A reviewer has been mentioned through the JIRA comments (see [the Maintainers list](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute#HowtoContribute-ReviewProcessandMaintainers)) - [ ] The pull request has been checked by the Teamcity Bot and the `green visa` attached to the JIRA ticket (see [TC.Bot: Check PR](https://mtcga.gridgain.com/prs.html)) ### 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 H2 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>)`, what do you think? -- 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]
