I'm using unowned relationship in a kind and I want to retrieve the
value of it and couldn't find any way or any discussion to retrieve
it. It is stored as google key with the following JDO annotion;

@Persistent
private Key REGION;

I retrieve all the data which is not google key and I also want to
retrieve the REGION value as key so I can use it to query region kind
and get some data from there also but I can't get the key value.
<cfscript>
getBranch = GoogleRead(Form.BRANCH_ID);
#getBranch.BRANCH_MANAGER#
getRegion = GoogleRead(getBranch.REGION);
</cfscript>

I've also tried
getRegion = GoogleRead(getBranch.REGION.getId());   which outputs the
ID/Name integer value 215.
getRegion = GoogleRead(getBranch.REGION.id);   which outputs the ID/
Name integer value 215.
getRegion = GoogleRead(getBranch.REGION);   which outputs region(215).
getRegion = GoogleRead(getBranch.REGION.googleKey());   which throws
following error.
Method googleKey could not be found. Check you have correct method
name, the method name casing matches that of the Java class and you've
provided the correct number of arguments

When I cfdump the getBranch.REGION its displayed as; object of
com.google.appengine.api.datastore.Key and displays 19 methods.
hashCode (returns int)
equals (returns boolean)
compareTo (returns int)
compareTo (returns int)
toString (returns java.lang.String)
getName (returns java.lang.String)
getParent (returns com.google.appengine.api.datastore.Key)
getId (returns long)
getChild (returns com.google.appengine.api.datastore.Key)
getChild (returns com.google.appengine.api.datastore.Key)
getNamespace (returns java.lang.String)
isComplete (returns boolean)
getKind (returns java.lang.String)
wait (returns void)
wait (returns void)
wait (returns void)
getClass (returns java.lang.Class)
notify (returns void)
notifyAll (returns void)

I also tried to get the data without reading from the datastore second
time like "getBranch.REGION.REGION_MANAGER" but get the following
error message.
java.lang.NoSuchFieldException


I want to mention that I use id as primary key in JDO definition.
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key id;

Best regards.

-- 
Open BlueDragon Public Mailing List
 http://www.openbluedragon.org/   http://twitter.com/OpenBlueDragon
 mailing list - http://groups.google.com/group/openbd?hl=en

 !! save a network - please trim replies before posting !!

Reply via email to