Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 20494 invoked from network); 20 Mar 2007 13:31:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Mar 2007 13:31:00 -0000 Received: (qmail 3293 invoked by uid 500); 20 Mar 2007 13:31:07 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 3249 invoked by uid 500); 20 Mar 2007 13:31:06 -0000 Mailing-List: contact user-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cayenne.apache.org Delivered-To: mailing list user@cayenne.apache.org Received: (qmail 3240 invoked by uid 99); 20 Mar 2007 13:31:06 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Mar 2007 06:31:06 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of blacknext@gmail.com designates 64.233.184.231 as permitted sender) Received: from [64.233.184.231] (HELO wr-out-0506.google.com) (64.233.184.231) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Mar 2007 06:30:57 -0700 Received: by wr-out-0506.google.com with SMTP id 71so1659601wri for ; Tue, 20 Mar 2007 06:30:36 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=r5EGBauwLthMWmhdpOlEKUiHUmFSuNKhvFRa3BhcKQEs3O55oUd405odk6npaORBQIXOCEe+DW/15e+7gCdUhmihdJZfWVMlNFv3OFRPNNzBa2LpdLBcaGI6N+4SAXTONGERlEWz0OC+zMZG3nnbsAN/YpdFv8UhOBV+M0gYjvs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=rEFCPu9MiIykRt9Dxj9Sab0npbmBjS6FmTZvxQen7EY82o6ZQNoI/gCvcamafiRp5j0PpclENSlceaj4WXQzT+gR+Zr8iJEQvft8BM1hdivafWkrH/vSXP4CvyzaZpbPN91VpspJmC4xDjmMGLLog/+lxnMiu/eJrvvLJR37tuM= Received: by 10.90.55.19 with SMTP id d19mr612017aga.1174397435804; Tue, 20 Mar 2007 06:30:35 -0700 (PDT) Received: by 10.90.87.3 with HTTP; Tue, 20 Mar 2007 06:30:35 -0700 (PDT) Message-ID: Date: Tue, 20 Mar 2007 09:30:35 -0400 From: "Michael Gentry" To: user@cayenne.apache.org Subject: Re: problems querying int,long In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_12566_354195.1174397435756" References: X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_12566_354195.1174397435756 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Well, given that I'm not entirely sure what you are trying to do ... On your: id = s.getSchedule_id(s.getId()); line, your getSchedule_id() method doesn't take a parameter, so that would generate an error. If you meant to call getSchedule(Long) there, then try something like this: id = s.getSchedule_id(new Long(s.getId())); Although I have to admit this seems a little confusing to me, too. If all you are trying to obtain is the ID, seems like you could get it calling your getSchedule_id() method. /dev/mrg On 3/19/07, Frank wrote: > > Hi Michael , > Here is more of my code: > I did not understand your statement > Thanks > Frank > > public class Schedules extends _Schedules { > public int getSchedule_id() { > return DataObjectUtils.intPKForObject(this); > } > > private String getProvider(long pid) { > .. > if (records.size() > -1) { > Schedules s = new Schedules(); > s = (Schedules)records.get(0); > // This line complains because it is an int value > id = s.getSchedule_id(s.getId()); > } > } > > private long getSchedule(Long pid) { > Expression qualifier = ExpressionFactory.matchExp("scheduleDate", > c.getTime()); > qualifier = > qualifier.andExp(ExpressionFactory.matchDbExp( > Schedules.PROVIDER_ID_PROPERTY, > pid)); > .. > } > ----- Original Message ----- > From: "Michael Gentry" > To: > Sent: Monday, March 19, 2007 1:20 PM > Subject: Re: problems querying int,long > > > > Try using a java.lang.Long or even a java.math.BigInteger. If you use > the > > BigInteger, use String.valueOf(yourLong) to pass into the constructor > > (BigInteger() will take a String, but not a long). > > > > /dev/mrg > > > > > > On 3/19/07, Frank wrote: > >> > >> Hello, > >> > >> I am getting hung up on passing int and long values to cayenne. > >> In my MySQL database, all PK fields are defined as BIGINT. > >> The PK in my cayenne schemas are defined as long. > >> ExpressionFactory.matchDbExp is looking for an object, I am passing in > a > >> long. > >> > >> What is the best way to handle this? > >> > >> > >> > >> Thanks > >> > >> Frank > >> > > > > ------=_Part_12566_354195.1174397435756--