From kevin55@example.org Mon Apr 12 19:14:52 2010
Return-Path: <kevin55@example.org>
Delivered-To: kevin55@example.org
Received: (qmail 75812 invoked from network); 12 Apr 2010 19:14:52 -0000
Received: from unknown (HELO mail.apache.org) (83.161.120.155)
  by 83.161.120.155 with SMTP; 12 Apr 2010 19:14:52 -0000
Received: (qmail 78651 invoked by uid 500); 12 Apr 2010 19:14:52 -0000
Mailing-List: contact kevin55@example.org; run by ezmlm
Precedence: bulk
List-Help: <mailto:kevin55@example.org>
List-Unsubscribe: <mailto:kevin55@example.org>
List-Post: <mailto:kevin55@example.org>
List-Id: <jdo-user.db.apache.org>
Reply-To: kevin55@example.org
Delivered-To: mailing list kevin55@example.org
Received: (qmail 78643 invoked by uid 99); 12 Apr 2010 19:14:52 -0000
Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Apr 2010 19:14:52 +0000
X-ASF-Spam-Status: No, hits=2.2 required=10.0
	tests=FREEMAIL_FROM,HTML_MESSAGE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: apache.org
Received-SPF: pass (nike.apache.org: domain of kevin55@example.org designates 83.161.120.155 as permitted sender)
Received: from [83.161.120.155] (HELO mail-pv0-f172.google.com) (83.161.120.155)
    by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Apr 2010 19:14:44 +0000
Received: by pvf33 with SMTP id 33so2657611pvf.31
        for <kevin55@example.org>; Mon, 12 Apr 2010 12:14:23 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=gamma;
        h=domainkey-signature:mime-version:received:from:date:received
         :message-id:subject:to:content-type;
        bh=y6OAuWszO1jVLbWKAD/KD9aceJzonNaBG0r60yx9xho=;
        b=U0wTqPhDCP4vtTGe6E1n72Fb2ObtwxxCgPixgkA51+LS0WMYVC+CAmj8i+aT2qQhJ2
         xGcqWk0XiGehd9y/tIQLZh/Nb7DH0hPC+ZExCODFJsI4zGJPOdux5unSkVpXb967zCaW
         CicTEi03GGGbIyGxsUjMy7BzOJ8gmVNbAvl8k=
DomainKey-Signature: a=rsa-sha1; c=nofws;
        d=gmail.com; s=gamma;
        h=mime-version:from:date:message-id:subject:to:content-type;
        b=e8Spjnfwhj9b54WeSzBDESH3FXuDxEowmB31NbccYj13Sj8x39TPjYcAiKedMgJdNk
         tbv2up+KB7kK7XBi7kI6hqOV9WNl58iHWjkJrW5w/ZnuUkpwgMO1oE2RMh5qbohh5OXo
         jklfSuRzmMAtZL54iEwVvhiyW5veKCry6SLpw=
MIME-Version: 1.0
Received: by 83.161.120.155 with HTTP; Mon, 12 Apr 2010 12:14:02 -0700 (PDT)
From: "Basil D'Souza" <kevin55@example.org>
Date: Tue, 13 Apr 2010 00:44:02 +0530
Received: by 83.161.120.155 with SMTP id s19mr4037964rvl.80.1271099662335; Mon, 
	12 Apr 2010 12:14:22 -0700 (PDT)
Message-ID: <kevin55@example.org>
Subject: getObjectById not working with a Custom PrimaryKey
To: kevin55@example.org
Content-Type: multipart/mixed; boundary=000e0cd112d6d900ef04840ef393
X-Virus-Checked: Checked by ClamAV on apache.org

--000e0cd112d6d900ef04840ef393
Content-Type: multipart/alternative; boundary=000e0cd112d6d900e704840ef391

--000e0cd112d6d900e704840ef391
Content-Type: text/plain; charset=ISO-8859-1

Hello Guys,

I am trying to build a relatively simple application on Google App Engine. I
am trying to use JDO to build my datalayer and am running into a load of
issues. I am very new to JDO so these might be newbie issues, but I cant
seem to proceed past this.

The problem is that when i try to access an object via getObjectByID and I
create a User key to pass to the function, I was getting different errors at
different times.
1. Error while trying to convert <stringified primary key object> into
internal key
2. Object not found

The detailed steps I performed are as follows:
1. Created a New Google App Engine Project
2. Created a new Entity: User (Code attached) (fields: firstName, lastName,
emailID)
3. Created a primaryKey: UserPK (on emailID ) // I know that i could use the
default key, but i need to do this way
4. Stored it vi
User user = new User(....., "kevin55@example.org");
pm.makePersistent(user)

5. Trying to access it by: UserPK pk = new
UserPK("com.basildsouza.odometer.datalayer.dataobjects.User$
UserPK888a:dbb7:2d49:b3f6:8605:bf4e:caed:kevin55@example.org <kevin55@example.org>")
pm.getObjectById(pk) // This doesnt work, was initially giving my error 1
(see above) and now gives me error 2

Also when i run a query like select from ...User where emailID=
kevin55@example.org, it does find the value properly, so i am at a loss as to
why the getObjectById isnt working.

Also, when i do pm.deletePersistant on an object i got via my above query, i
get an error saying that the primary key is null.

What i have understood from this, is that for some reason the primary key
isnt getting set for the user object. But i dont know why.

Please Help!

Code Attached:
User.java (with the UserPK as an inner static class) (Pardon the mess :)
jdoconfig.xml (generated by google)



--
Regards,
Basil Dsouza
http://www.basildsouza.com

--000e0cd112d6d900e704840ef391
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hello Guys,<br><br>I am trying to build a relatively simple application on =
Google App Engine. I am trying to use JDO to build my datalayer and am runn=
ing into a load of issues. I am very new to JDO so these might be newbie is=
sues, but I cant seem to proceed past this.<br>

<br>The problem is that when i try to access an object via getObjectByID an=
d I create a User key to pass to the function, I was getting different erro=
rs at different times.<br>1. Error while trying to convert &lt;stringified =
primary key object&gt; into internal key<br>

2. Object not found<br><br>The detailed steps I performed are as follows:<b=
r>1. Created a New Google App Engine Project<br>2. Created a new Entity: Us=
er (Code attached) (fields: firstName, lastName, emailID)<br>3. Created a p=
rimaryKey: UserPK (on emailID ) // I know that i could use the default key,=
 but i need to do this way<br>

4. Stored it vi <br>User user =3D new User(....., &quot;<a href=3D"mailto:t=
kevin55@example.org">kevin55@example.org</a>&quot;);<br>pm.makePersistent(user)<br=
><br>5. Trying to access it by: UserPK pk =3D new UserPK(&quot;com.basildso=
uza.odometer.datalayer.dataobjects.User$<a href=3D"mailto:UserPK%3A%3Atest@=
example.com">UserPK888a:dbb7:2d49:b3f6:8605:bf4e:caed:kevin55@example.org</a>&quot;)<br>

pm.getObjectById(pk) // This doesnt work, was initially giving my error 1 (=
see above) and now gives me error 2<br><br>Also when i run a query like sel=
ect from ...User where emailID=3D<a href=3D"mailto:kevin55@example.org">test@e=
xample.com</a>, it does find the value properly, so i am at a loss as to wh=
y the getObjectById isnt working.<br>

<br>Also, when i do pm.deletePersistant on an object i got via my above que=
ry, i get an error saying that the primary key is null.<br><br>What i have =
understood from this, is that for some reason the primary key isnt getting =
set for the user object. But i dont know why.<br>

<br>Please Help!<br><br>Code Attached: <br>User.java (with the UserPK as an=
 inner static class) (Pardon the mess :)<br>jdoconfig.xml (generated by goo=
gle)<br><br><br><br clear=3D"all">--<br>Regards,<br>Basil Dsouza<br><a href=
=3D"http://www.basildsouza.com">http://www.basildsouza.com</a><br>



--000e0cd112d6d900e704840ef391--
--000e0cd112d6d900ef04840ef393
Content-Type: text/xml; charset=US-ASCII; name="jdoconfig.xml"
Content-Disposition: attachment; filename="jdoconfig.xml"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_g7xnwglr1

PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPGpkb2NvbmZpZyB4bWxucz0i
aHR0cDovL2phdmEuc3VuLmNvbS94bWwvbnMvamRvL2pkb2NvbmZpZyIKICAgeG1sbnM6eHNpPSJo
dHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYS1pbnN0YW5jZSIKICAgeHNpOm5vTmFtZXNw
YWNlU2NoZW1hTG9jYXRpb249Imh0dHA6Ly9qYXZhLnN1bi5jb20veG1sL25zL2pkby9qZG9jb25m
aWciPgoKICAgPHBlcnNpc3RlbmNlLW1hbmFnZXItZmFjdG9yeSBuYW1lPSJ0cmFuc2FjdGlvbnMt
b3B0aW9uYWwiPgogICAgICAgPHByb3BlcnR5IG5hbWU9ImphdmF4Lmpkby5QZXJzaXN0ZW5jZU1h
bmFnZXJGYWN0b3J5Q2xhc3MiCiAgICAgICAgICAgdmFsdWU9Im9yZy5kYXRhbnVjbGV1cy5zdG9y
ZS5hcHBlbmdpbmUuamRvLkRhdGFzdG9y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