db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dave Sunerton-Burl (JIRA)" <j...@apache.org>
Subject [jira] Created: (DDLUTILS-3) Column names are different case between getInstance and query in DynaSql
Date Fri, 15 Jul 2005 19:54:09 GMT
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
 Assigned to: 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


Mime
View raw message