db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Travis.Presc...@novainfo.com
Subject RE: simple join problem
Date Tue, 02 Mar 2004 13:52:01 GMT
Of course, when you use the "addJoin" & not the "add", it works just fine.
Any idea how to use your own connection when using the *Peer join methods?
As I mentioned, I need to have the application server manage the datasource
for me so I have been using the methods that take a connection as well as a


-----Original Message-----
From: Andras Balogh [mailto:andras@reea.net]
Sent: Tuesday, March 02, 2004 8:18 AM
To: Apache Torque Users List
Subject: Re: simple join problem


You should use
Crieteria.addJoin(ViRejPeer.ASSN_REJ_ID, AssnRejPeer.ASSN_REJ_ID);
ot better if the relationship is declared as foriegn key in your schema 
you should have
a protected method in you BaseViRejPeer:

ViRejPeer.doSelectJoinAssnRej(crit) (or somethig like that :))

Make this method public in 
ViRejPeer and use it .

Best wishes,

Travis.Prescott@novainfo.com wrote:

>I am trying to make a simple join.  Below is the Criteria I am using:
>  Criteria crit = new Criteria();
>  crit.add(ViRejPeer.ASSN_REJ_ID, AssnRejPeer.ASSN_REJ_ID);
>  crit.add(AssnRejPeer.REJ_STATUS_ID, 1000);
>The query does not work because of an "invalid number".  I know what is
>causing the Oracle error.  The Criteria produces the following query:
>  SELECT * 
>  FROM assn_rej, vi_rej 
>  WHERE assn_rej.REJ_STATUS_ID=1000 
>  AND vi_rej.ASSN_REJ_ID='assn_rej.ASSN_REJ_ID'
>The cause of the problem is the assn_rej.ASSN_REJ_ID value surrounded by
>quotes.  If the query is run on it's own without the quotes it runs fine.
>So, I started looking into the join provided by the Peer base class.  The
>problem with this is that we are managing our datasources with application
>server so I would need to pass a connection into the join method.  This
>option does not exist.  So my question, I suppose, is two-fold.  First,
>am I doing wrong with the above Criteria.  Second, is there a way to use
>join methods in the Peer classes and still pass in a Connection?

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

Note:  The information contained in this email and in any attachments is
intended only for the person or entity to which it is addressed and may
contain confidential and/or privileged material.  Any review,
retransmission, dissemination or other use of, or taking of any action in
reliance upon, this information by persons or entities other than the
intended recipient is prohibited.  The recipient should check this email and
any attachments for the presence of viruses.  Sender accepts no liability
for any damages caused by any virus transmitted by this email. If you have
received this email in error, please notify us immediately by replying to
the message and delete the email from your computer.  This e-mail is and any
response to it will be unencrypted and, therefore, potentially unsecure.
Thank you.  NOVA Information Systems, Inc.

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

View raw message