db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <tfisc...@apache.org>
Subject RE: Criteria.setDbName() and BaseXXXPeer.setDbName()
Date Sun, 15 Apr 2007 10:47:11 GMT
> I'd suggest at least the following change:
> - if Criteria.setDbName(null) is called, criteria's DbName instance
> variable should set to null, not Torque.getDefaultDb(). Null values are 
> not
> a problem, the instance variable is null anyway if it is not explicitly
> set.
> - in BaseXXXPeer, the check should be changed from if (crit.getDbName() 
> == Torque.getDefaultDB()) to if (crit.getDbName() == null)

This is not as easy as I thought. The problem is that I was mistaken about 
criteria.getDbName() would return null if criteria.setDbName() was not 
used. This is not true, instead criteria.getDbName() returns 

So if the above change would be made, one would either have to check every 
place where Criteria.getDbName() is used and use Torque.getDefaultDb() if 
Criteria.getDbName() is null. This is about 20 places in Torque's code. 
Alternatively, one could allow null as database name in other places, such 
as Torque.getConnection(String dbName).

Then, Criteria.getDbName() is public, so this method can be called by he 
user. If this is done and the return value is not checked for null, it 
will break the user's code.

So I'd rather not have this change between RC's.

Apropos, this kind of stuff (I'd like to change stuff but not between 
RC's) seems to pile up. We should try to get 3.3 out soon. Anything except 
solutions for the Turbine issue and the "delete with joins" problem needed 
for getting out RC3 ?


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

View raw message