db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Bowen <s...@yahoo.com>
Subject Problem with BasePeer "factory" and Criteria objects ...
Date Wed, 18 Aug 2004 10:36:29 GMT
Hello. I have created a "factory" to instantiate a
BasePeer class based on a string, entity. 

My code looks like this:

BasePeer objectPeer =

... So if I receive "myEntity" as the string, it
should call the createObjectPeer() method, which does
the following:

return new MyEntityPeer();

Great. But when I create a new Criteria() object and
call objectPeer.doSelect(), my SQL string is "SELECT
FROM". In other words it is missing the column names
and table name.

>From looking at the mail archives I see this is
because you must call explicitly
MyEntityBasePeer.doSelect(), and not just
BasePeer.doSelect(), if you want it to automatically
populate the SELECT statement.

So I need do a cast somewhere ... But I don't want to
put a bunch of "if" statements, like:

if (entity=='x')

... Any suggestions?


Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.

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

View raw message