Return-Path: Delivered-To: apmail-db-ddlutils-dev-archive@www.apache.org Received: (qmail 29864 invoked from network); 19 Jul 2005 16:49:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 19 Jul 2005 16:49:21 -0000 Received: (qmail 92874 invoked by uid 500); 19 Jul 2005 16:49:20 -0000 Delivered-To: apmail-db-ddlutils-dev-archive@db.apache.org Received: (qmail 92852 invoked by uid 500); 19 Jul 2005 16:49:20 -0000 Mailing-List: contact ddlutils-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ddlutils-dev@db.apache.org Delivered-To: mailing list ddlutils-dev@db.apache.org Delivered-To: moderator for ddlutils-dev@db.apache.org Received: (qmail 82551 invoked by uid 99); 19 Jul 2005 12:39:03 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Message-ID: <2011837677.1121776728113.JavaMail.jira@ajax.apache.org> Date: Tue, 19 Jul 2005 14:38:48 +0200 (CEST) From: "Thomas Dudziak (JIRA)" To: ddlutils-dev@db.apache.org Subject: [jira] Commented: (DDLUTILS-3) Column names are different case between getInstance and query in DynaSql In-Reply-To: <1861450022.1121457249546.JavaMail.jira@ajax.apache.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/DDLUTILS-3?page=comments#action_12316084 ] Thomas Dudziak commented on DDLUTILS-3: --------------------------------------- Yeah, thats because most databases are case insensitive. Since this info is available, it should be possible to match (upon reading) the property names of the beans with the model, and use the column names from the model. I'll have a look into it. > Column names are different case between getInstance and query in DynaSql > ------------------------------------------------------------------------ > > Key: DDLUTILS-3 > URL: http://issues.apache.org/jira/browse/DDLUTILS-3 > Project: DdlUtils > Type: Bug > Environment: HSQLDB > Reporter: Dave Sunerton-Burl > Assignee: Thomas Dudziak > > When getting a DynaBean using getInstance("TABLE_NAME") the property names are uppercase. When getting a DynaBean from an Iterator using query("SELECT * FROM TABLE_NAME") the properties are lowercase. This means that the copy() method returns a DynaBean where all the properties are null, which makes doing updates difficult. > I have a test method in my code which shows this problem; > public void testColumnNames() throws Exception { > JdbcModelReader reader = new JdbcModelReader(loaderDb.getDataSource() > .getConnection()); > Database database = reader.getDatabase(); > DynaSql dynaSql = new DynaSql( > SqlBuilderFactory.newSqlBuilder("hsqldb"), loaderDb > .getDataSource(), database); > DynaBean beanFromSchema = dynaSql.newInstance("TEST"); > Iterator iter = dynaSql.query("SELECT * FROM TEST"); > DynaBean beanFromQuery = (DynaBean) iter.next(); > assertEquals(beanFromSchema.getDynaClass().getDynaProperties()[0] > .getName(), beanFromQuery.getDynaClass().getDynaProperties()[0] > .getName()); > } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira