db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Engelhardt, ITS BetrWi AE2, FD" <D.Engelhar...@DeutschePost.de>
Subject AW: simple join problem
Date Tue, 02 Mar 2004 13:14:24 GMT
Hi Travis,

you have to uses  crit.addJoin() instead crit.add(ViRejPeer.ASSN_REJ_ID, AssnRejPeer.ASSN_REJ_ID);

Dieter

-----Ursprüngliche Nachricht-----
Von: Travis.Prescott@novainfo.com [mailto:Travis.Prescott@novainfo.com]
Gesendet: Dienstag, 2. März 2004 14:11
An: torque-user@db.apache.org
Betreff: simple join problem


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, what
am I doing wrong with the above Criteria.  Second, is there a way to use the
join methods in the Peer classes and still pass in a Connection?

Travis

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

---------------------------------------------------------------------
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