Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 99781 invoked from network); 7 Oct 2004 19:37:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 7 Oct 2004 19:37:40 -0000 Received: (qmail 85158 invoked by uid 500); 7 Oct 2004 19:37:06 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 85029 invoked by uid 500); 7 Oct 2004 19:37:05 -0000 Mailing-List: contact torque-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Apache Torque Users List" Reply-To: "Apache Torque Users List" Delivered-To: mailing list torque-user@db.apache.org Received: (qmail 84975 invoked by uid 99); 7 Oct 2004 19:37:04 -0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_20_30,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [66.218.93.107] (HELO web41607.mail.yahoo.com) (66.218.93.107) by apache.org (qpsmtpd/0.28) with SMTP; Thu, 07 Oct 2004 12:37:01 -0700 Message-ID: <20041007193643.64323.qmail@web41607.mail.yahoo.com> Received: from [63.87.1.107] by web41607.mail.yahoo.com via HTTP; Thu, 07 Oct 2004 12:36:43 PDT Date: Thu, 7 Oct 2004 12:36:43 -0700 (PDT) From: Swaminathan Gurumoorthy Subject: RE: Newbie --> getCriterion() Question To: Apache Torque Users List In-Reply-To: <200410072006.QAA07020@mailp.ascindia.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-653164663-1097177803=:63161" X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N --0-653164663-1097177803=:63161 Content-Type: text/plain; charset=us-ascii Say I am writing a criteria equivalent to select * from employee where salary < 10000 or salary > 20000 and I do this using Criteria crit = new Criteria();Criteria.Criterion a1 = crit.getNewCriterion(EMPLOYEE.salary, 10000, Criteria.LESS_THAN);Criteria.Criterion a2 = crit.getNewCriterion(EMPLOYEE.salary, 20000, Criteria.GREATER_THAN);crit.add(a1.or(a2)); Now there are two criterion on the same field ( or that's what i assume). Which criterion will getCriterion("EMPLOYEE.salary") return? Thanks Swami Kalyani Kale wrote: Hi, According to my understanding, Both these methods essentially do the same thing. They return a criteria associated with the column. But in the getCriterion( String column ) method, the 'columnName' string is of type 'tableName.columnName'. Whereas in the getCriterion( String tableName, String columnName ) method, the table name is explicitly provided. for e.g. getCriteron("Employee.empid") getCriterion("Employee", "empid") Hope this helps. Kalyani -----Original Message----- From: Swaminathan Gurumoorthy [mailto:swamiolympus@yahoo.com] Sent: Thursday, October 07, 2004 1:56 PM To: torque-user@db.apache.org Subject: Newbie --> getCriterion() Question Hi I am trying out torque for my data persistence. I had a question. The criteria class has two getCriterion() methods - one that takes a column and another that takes a table name and column name. The javadoc was not very descriptive and so it was kinda confusing to find out the difference between these two. Can somebody explain with a simple eg. Appreciate it. Swami --------------------------------- Do you Yahoo!? vote.yahoo.com - Register online to vote today! --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org --------------------------------- Do you Yahoo!? Yahoo! Mail - You care about security. So do we. --0-653164663-1097177803=:63161--