db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Göschl,Siegfried" <Siegfried.Goes...@drei.com>
Subject Covertinf Village to Torque records - WAS: RE: Criteria parses to "SELECT FROM .."
Date Wed, 14 Jul 2004 08:26:33 GMT
Hi folks,

I lost somehow the track but a conversion from Village to Torque is done like

=== SNIPPET FROM MODIFIED VELOCITY TEMPLATE ===

    /**
     * Do a Prepared Statement select according to the given criteria
     *
     * @param criteria The criteria used for the SELECT
     * @param con The connection to be used
     * @return Result as Torque generated objects and NOT Village Records
     * @throws TorqueException Any exceptions caught during processing will be
     *         rethrown wrapped into a TorqueException.
     */
    public static List doPSSelectEx(Criteria criteria,Connection con) throws TorqueException
    {
     	List v = null;
     	List temp = null;
     	
    	// add the columns to the criteria
    	BaseCountryPeer.addSelectColumns( criteria );
    	// invoke the BasePeer to get the list of Village Records
    	temp = BaseCountryPeer.doPSSelect( criteria, con );
    	// convert the VillageRecords into Torque objects
	v = BaseCountryPeer.populateObjects( temp );
	return v;
    }

===

Cheers,

Siegfried Goeschl

-----Original Message-----
From: ron piterman [mailto:ron.piterman@gmx.net] 
Sent: Mittwoch, 14. Juli 2004 09:58
To: Apache Torque Users List
Subject: Re: Criteria parses to "SELECT FROM .."


Hi, many thanx for your answer, and - about the english - mine is not 
better ;-) so forget about it...
Anyway, I tried it and it doesn't help (solution 1).
solution 2 is not applicable because I really need the Object and not 
the Village things...
hmm... :-(


florianfray@compuserve.de wrote:

>Hi Ron!
>
>I suggest your class is named LanguagePeer. If it is not, change it to
>the appropiate name in the following statements.
>
>2 Solutions:
>
>1.) change the line "return doSelect(c)" to "LanguagePeer.doSelect(c)"
>since
>doSelect(Criteria) exists in BasePeer, too and since it is static and 
>because of this it's overriden.
>
>2.) add a line "addSelectColumns(c)" before the try catch-block.
>
>This code should have another mistake: It should never give back a
>list of Language-Objects, but it should return a list of Village-
>Records. 
>I guess this is not what you want. Solution 1.) will solve this 
>problem, too. 2.) won't.
>
>Hope it helps
>
>F. Fray
>
>PS Nevermind! This is a quick answer, so dont care about my english!
>
>
>  
>
>-----------------------------------------------------------------------
>-
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
>For additional commands, e-mail: torque-user-help@db.apache.org
>

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


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


Mime
View raw message