You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by "Thomas Fox (Resolved) (JIRA)" <ji...@apache.org> on 2012/03/15 16:33:37 UTC

[jira] [Resolved] (TORQUE-188) dbName == null should be interpreted as default database

     [ https://issues.apache.org/jira/browse/TORQUE-188?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Fox resolved TORQUE-188.
-------------------------------

    Resolution: Fixed
    
> dbName == null should be interpreted as default database
> --------------------------------------------------------
>
>                 Key: TORQUE-188
>                 URL: https://issues.apache.org/jira/browse/TORQUE-188
>             Project: Torque
>          Issue Type: Improvement
>            Reporter: Thomas Fox
>            Assignee: Thomas Fox
>             Fix For: 4.0
>
>
> If the name of a database is null, it should be hendled exactly as if the name of the database was set to the default database's name
> Background: In the Torque 4 trunk, the setDbName in the generated peers is generated as follows:
>     private static void setDbName(Criteria crit) throws TorqueException
>     {
>         if (!Torque.isInit())
>         {
>             throw new TorqueException("Torque is not initialized");
>         }
>         if (Torque.getDefaultDB().equals(crit.getDbName()))
>         {
>             crit.setDbName(${peerClassName}.DATABASE_NAME);
>         }
>     }
> So if I set the database name to the name of the default db it is always switched to the name of the table's default when querying the database, which I did not mean to do. 
> In Torque 3 the check was == instead of equals, which did the trick but caused findbugs to yell.
> The clean solution is to use null for "not set" in the criteria.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org