Inline… On Thu, Jun 30, 2016 at 2:15 AM, Alexey Kuznetsov <akuznet...@gridgain.com> wrote:
> Igniters! > > We already have several cases when underlying database return something > that CacheJdbcPojoStore failed to transform to expected java types, for > example > we have two issues with Oracle Date and Timestamp. > > All logic is encoded in method: > "o.a.i.cache.store.jdbc.CacheAbstractJdbcStore.getColumnValue(ResultSet rs, > int colIdx, Class<?> type)". > > This method contains some simple code that convert object received from > database to expected java class. > > And we cannot handle vendor specific classes (for example > oracle.sql.TIMESTAMP) because ignite-core module cannot depends on vendor > JDBC drivers. > Hm… Why don’t you use reflection to handle such types? If the driver is there, then load the class, otherwise don’t? > > But user could write its own transformer and put it in class path and set > on CacheJdbcPojoStore configuration. > > I'm thinking on introducing base class JdbcTypesTransformer with method > "Object transform(ResultSet rs, int colIdx, Class<?> type)" and move all > current logic there. > Agree. How will the transformer be specified in configuration? > > And it will be default transformer on JDBC POJO store. > > And in case if one will face issue when default transformer failed to > transform value returned from database he will need to write a custom class > and put it into node classpath and set on JDBC POJO store configuration. > > Any suggestions are welcome. > > -- > Alexey Kuznetsov >