You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@metamodel.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2015/10/02 20:50:26 UTC
[jira] [Commented] (METAMODEL-157) Jdbc delete uses
Statement.setObject(...) which isn't always supported
[ https://issues.apache.org/jira/browse/METAMODEL-157?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14941559#comment-14941559 ]
ASF GitHub Bot commented on METAMODEL-157:
------------------------------------------
GitHub user kaspersorensen opened a pull request:
https://github.com/apache/metamodel/pull/52
METAMODEL-157: Improved datatype handling in JDBC DELETE operations
My suggested fix for METAMODEL-157
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/kaspersorensen/metamodel METAMODEL-157
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/metamodel/pull/52.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #52
----
commit 119ffe3e785b5436608dc7bf03fafdd138581486
Author: Kasper Sørensen <i....@gmail.com>
Date: 2015-10-02T18:48:54Z
METAMODEL-157: Improved datatype handling in JDBC DELETE operations
----
> Jdbc delete uses Statement.setObject(...) which isn't always supported
> ----------------------------------------------------------------------
>
> Key: METAMODEL-157
> URL: https://issues.apache.org/jira/browse/METAMODEL-157
> Project: Apache MetaModel
> Issue Type: Bug
> Environment: PostgreSQL.
> MetaModel-jdbc module.
> Reporter: Kasper Sørensen
> Labels: starter
>
> I am trying to express a delete criteria using a date as the criteria for deleting. Like this for example:
> {code}
> DELETE FROM table WHERE date_created = '2015-07-01'
> {code}
> The problem I run into is that my database driver (PostgreSQL) is complaining about the Statement.setObject(...) call we are doing in JdbcDeleteBuilder line 73. I am passing in a java.util.Date and apparently it's not able to properly handle it.
> I notice that in e.g. JdbcUpdateBuilder (line 75) we use JdbcUtils.setStatementValue(...). I imagine that doing this instead provides a better call into the JDBC API and thus will get me out of my current JDBC driver exception.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)