You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@metamodel.apache.org by "Tanner Hobson (JIRA)" <ji...@apache.org> on 2015/08/13 17:31:46 UTC
[jira] [Closed] (METAMODEL-169) JdbcDataSet returning java.sql.Date
instead of java.util.Date
[ https://issues.apache.org/jira/browse/METAMODEL-169?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tanner Hobson closed METAMODEL-169.
-----------------------------------
Resolution: Not A Problem
> JdbcDataSet returning java.sql.Date instead of java.util.Date
> -------------------------------------------------------------
>
> Key: METAMODEL-169
> URL: https://issues.apache.org/jira/browse/METAMODEL-169
> Project: Apache MetaModel
> Issue Type: Bug
> Environment: MySQL
> Reporter: Tanner Hobson
> Priority: Minor
>
> I'm not sure if this really counts as a bug or if it is intentional.
> When using any DataSet, I would expect that getting a value with a SelectItem type of ColumnType.DATE would result in a java.util.Date (which is also what getJavaEquivalentClass() returns), but the JdbcDataSet returns a java.sql.Date.
> This happens because JdbcDataSet.getValue() returns the value of ResultSet.getDate(), which is a java.sql.Date.
> To be consistent with getJavaEquivalentClass(), it would be helpful to convert it to a java.util.Date, unless there is some other reason why this method returns a java.sql.Date that I don't know.
> We could also add a flag which controls whether this transformation occurs or not, so that existing code doesn't break.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)