Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 12A061105E for ; Sun, 20 Jul 2014 08:49:40 +0000 (UTC) Received: (qmail 14125 invoked by uid 500); 20 Jul 2014 08:49:39 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 14032 invoked by uid 500); 20 Jul 2014 08:49:39 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 14016 invoked by uid 99); 20 Jul 2014 08:49:39 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 20 Jul 2014 08:49:39 +0000 Date: Sun, 20 Jul 2014 08:49:39 +0000 (UTC) From: "Benedikt Ritter (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Closed] (DBUTILS-113) Add support for conversion of ResultSet strings to enums in the BeanProcessor MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DBUTILS-113?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Benedikt Ritter closed DBUTILS-113. ----------------------------------- > Add support for conversion of ResultSet strings to enums in the BeanProcessor > ----------------------------------------------------------------------------- > > Key: DBUTILS-113 > URL: https://issues.apache.org/jira/browse/DBUTILS-113 > Project: Commons DbUtils > Issue Type: Improvement > Reporter: Graylin Kim > Assignee: Benedikt Ritter > Priority: Minor > Labels: patch > Fix For: 1.6 > > Attachments: DBUTILS-113.patch, DBUTILS-113.patch, bean_enums.diff, bean_enums2.diff, bean_enums3.diff, bean_enums4.patch > > > When using commons-dbutils I frequently use enum values with corresponding enum in the database. In this situation, using the BeanListHandler produces the following exception causing me to write a custom bean handler for enum conversion. > {quote} > Cannot set status: incompatible types, cannot convert java.lang.String to gov.nysenate.openleg.util.Storage$Status Query: SELECT * FROM changelog WHERE 1=1 AND time >= ? AND time <= ? Parameters: [2013-07-24 00:00:00, 2013-07-26 23:59:59] > java.sql.SQLException: Cannot set status: incompatible types, cannot convert java.lang.String to gov.nysenate.openleg.util.Storage$Status Query: SELECT * FROM changelog WHERE 1=1 AND time >= ? AND time <= ? Parameters: [2013-07-24 00:00:00, 2013-07-26 23:59:59] > at org.apache.commons.dbutils.AbstractQueryRunner.rethrow(AbstractQueryRunner.java:363) > at org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:350) > at org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:288) > {quote} > It seems to me that commons-dbutils should be able to handle this conversion. -- This message was sent by Atlassian JIRA (v6.2#6252)