metamodel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tanner Hobson (JIRA)" <>
Subject [jira] [Commented] (METAMODEL-169) JdbcDataSet returning java.sql.Date instead of java.util.Date
Date Thu, 13 Aug 2015 15:31:46 GMT


Tanner Hobson commented on METAMODEL-169:

Oh, I guess I forgot to check if sql.Date is a util.Date. I knew there were issues going from
a util.Date to a sql.Date, so I figured there were similar issues going the other way, but
that's definitely not the case. 

I'll go ahead and close this issue. Thank you for the quick response.

> JdbcDataSet returning java.sql.Date instead of java.util.Date
> -------------------------------------------------------------
>                 Key: METAMODEL-169
>                 URL:
>             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

View raw message