<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Google App Engine + JAVA + JDO + Inheritance + One-To-Many Relationships</title>
	<atom:link href="http://www.wetfeetblog.com/google-app-engine-java-jdo-inheritance-one-to-many-relationships/242/feed" rel="self" type="application/rss+xml" />
	<link>http://www.wetfeetblog.com/google-app-engine-java-jdo-inheritance-one-to-many-relationships/242</link>
	<description></description>
	<lastBuildDate>Mon, 19 Jul 2010 21:09:44 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Tomas Mazukna</title>
		<link>http://www.wetfeetblog.com/google-app-engine-java-jdo-inheritance-one-to-many-relationships/242/comment-page-1#comment-502</link>
		<dc:creator>Tomas Mazukna</dc:creator>
		<pubDate>Tue, 06 Jul 2010 12:35:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.wetfeetblog.com/?p=242#comment-502</guid>
		<description>Its the same as ModelBase, I just copy-pasted from different Project where it is called EntityBase.</description>
		<content:encoded><![CDATA[<p>Its the same as ModelBase, I just copy-pasted from different Project where it is called EntityBase.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Prabuddha</title>
		<link>http://www.wetfeetblog.com/google-app-engine-java-jdo-inheritance-one-to-many-relationships/242/comment-page-1#comment-501</link>
		<dc:creator>Prabuddha</dc:creator>
		<pubDate>Tue, 06 Jul 2010 11:02:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.wetfeetblog.com/?p=242#comment-501</guid>
		<description>Can you post the EntityBase class. Is it any different from the ModelBase class</description>
		<content:encoded><![CDATA[<p>Can you post the EntityBase class. Is it any different from the ModelBase class</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tomas Mazukna</title>
		<link>http://www.wetfeetblog.com/google-app-engine-java-jdo-inheritance-one-to-many-relationships/242/comment-page-1#comment-490</link>
		<dc:creator>Tomas Mazukna</dc:creator>
		<pubDate>Fri, 04 Jun 2010 11:34:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.wetfeetblog.com/?p=242#comment-490</guid>
		<description>Bruce,

Your observation is correct - you can not have children of the same class. 
My hunch is that it is due to the implementation of the Key class. 
Each child Key holds reference to parent key/id. In theory it should be possible to have child of the same type, but I think current implementation does not allow it. Maybe to safeguard for infinite loop where you make same object child and parent......

Tomas</description>
		<content:encoded><![CDATA[<p>Bruce,</p>
<p>Your observation is correct &#8211; you can not have children of the same class.<br />
My hunch is that it is due to the implementation of the Key class.<br />
Each child Key holds reference to parent key/id. In theory it should be possible to have child of the same type, but I think current implementation does not allow it. Maybe to safeguard for infinite loop where you make same object child and parent&#8230;&#8230;</p>
<p>Tomas</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bruce</title>
		<link>http://www.wetfeetblog.com/google-app-engine-java-jdo-inheritance-one-to-many-relationships/242/comment-page-1#comment-469</link>
		<dc:creator>Bruce</dc:creator>
		<pubDate>Sat, 22 May 2010 02:31:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.wetfeetblog.com/?p=242#comment-469</guid>
		<description>Tomas,

could you help me a bit if you have time?
yesterday I was trying to model a simple forum comments. Just a
comments which you can add more comments to.
So, the approximation of the entity is like this:
-------------------------------------------------------------------
@PersistenceCapable (detachable = &quot;true&quot;, identityType =
IdentityType.APPLICATION)
public class CommentEntity {

       @PrimaryKey
       @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
       private Key key;

       @Persistent
       private String category;

       @Persistent
       private String commentDate;

       @Persistent
       private String userName;

       @Persistent
       private String commentBody;

       @Persistent
       private List children = new
ArrayList();

       getters/setters/etc.
}

DataNucleus enhancement goes ok, no errors in the console.
Call of the pm.makePersistent() goes without any exceptions for such
entity.
BUT IT IS NOT PERSISTED.

I found out that problem is in &quot;children&quot; property. And the problem is
it&#039;s a list of objects of the same class as the parent entity. If I
comment that property declaration the entity is persisted. Also if I
change the type of the child entities to some new class (not extending
the CommentEntity) it also gets persisted.

So my suspicion is that JDO (or GAE JDO impl) does not allow child
entities to be of the same class. Is it correct? Maybe I&#039;m missing
something essential? Please advice.</description>
		<content:encoded><![CDATA[<p>Tomas,</p>
<p>could you help me a bit if you have time?<br />
yesterday I was trying to model a simple forum comments. Just a<br />
comments which you can add more comments to.<br />
So, the approximation of the entity is like this:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
@PersistenceCapable (detachable = &#8220;true&#8221;, identityType =<br />
IdentityType.APPLICATION)<br />
public class CommentEntity {</p>
<p>       @PrimaryKey<br />
       @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)<br />
       private Key key;</p>
<p>       @Persistent<br />
       private String category;</p>
<p>       @Persistent<br />
       private String commentDate;</p>
<p>       @Persistent<br />
       private String userName;</p>
<p>       @Persistent<br />
       private String commentBody;</p>
<p>       @Persistent<br />
       private List children = new<br />
ArrayList();</p>
<p>       getters/setters/etc.<br />
}</p>
<p>DataNucleus enhancement goes ok, no errors in the console.<br />
Call of the pm.makePersistent() goes without any exceptions for such<br />
entity.<br />
BUT IT IS NOT PERSISTED.</p>
<p>I found out that problem is in &#8220;children&#8221; property. And the problem is<br />
it&#8217;s a list of objects of the same class as the parent entity. If I<br />
comment that property declaration the entity is persisted. Also if I<br />
change the type of the child entities to some new class (not extending<br />
the CommentEntity) it also gets persisted.</p>
<p>So my suspicion is that JDO (or GAE JDO impl) does not allow child<br />
entities to be of the same class. Is it correct? Maybe I&#8217;m missing<br />
something essential? Please advice.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tomas Mazukna</title>
		<link>http://www.wetfeetblog.com/google-app-engine-java-jdo-inheritance-one-to-many-relationships/242/comment-page-1#comment-455</link>
		<dc:creator>Tomas Mazukna</dc:creator>
		<pubDate>Sun, 02 May 2010 17:26:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.wetfeetblog.com/?p=242#comment-455</guid>
		<description>Please provide test.shared.Address and Person implementations.

thanks,
Tomas</description>
		<content:encoded><![CDATA[<p>Please provide test.shared.Address and Person implementations.</p>
<p>thanks,<br />
Tomas</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vivek</title>
		<link>http://www.wetfeetblog.com/google-app-engine-java-jdo-inheritance-one-to-many-relationships/242/comment-page-1#comment-454</link>
		<dc:creator>Vivek</dc:creator>
		<pubDate>Sun, 02 May 2010 16:35:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.wetfeetblog.com/?p=242#comment-454</guid>
		<description>Hi

i have been trying to persist a object with arraylist of objects (1-many relationship)  however i always ran into some problem or other. and finally decided to use the example here ... but again ran into a problem .. the error is 

Caused by: java.lang.IllegalArgumentException: addresses: test.shared.Address is not a supported property type.

I am using the following code to persist the object person with addresses


	ArrayList aa = new ArrayList();
	aa.add(new Address(&quot;123 sasdf&quot;, &quot;&quot;, &quot;Some City&quot;, &quot;AZ&quot;, &quot;93923-2321&quot;));
	aa.add(new Address(&quot;23432 asdf&quot;, &quot;Appt 34&quot;, &quot;Another City&quot;, &quot;AZ&quot;, &quot;43434-4432&quot;));
	ArrayList parray = new ArrayList();
	Person p = new Person();
	p.setName(&quot;VVVVVVV&quot;);
	p.setAge(23);
	p.setGender(&#039;m&#039;);
	p.setAddresses(aa);
	PersistenceManager pm = PMF.get().getPersistenceManager();
	pm.makePersistent(p);
	pm.close();

by the looks of it ... i am sure there is something very simple which i am missing but not able to put a finger to it.

Please help...</description>
		<content:encoded><![CDATA[<p>Hi</p>
<p>i have been trying to persist a object with arraylist of objects (1-many relationship)  however i always ran into some problem or other. and finally decided to use the example here &#8230; but again ran into a problem .. the error is </p>
<p>Caused by: java.lang.IllegalArgumentException: addresses: test.shared.Address is not a supported property type.</p>
<p>I am using the following code to persist the object person with addresses</p>
<p>	ArrayList aa = new ArrayList();<br />
	aa.add(new Address(&#8220;123 sasdf&#8221;, &#8220;&#8221;, &#8220;Some City&#8221;, &#8220;AZ&#8221;, &#8220;93923-2321&#8243;));<br />
	aa.add(new Address(&#8220;23432 asdf&#8221;, &#8220;Appt 34&#8243;, &#8220;Another City&#8221;, &#8220;AZ&#8221;, &#8220;43434-4432&#8243;));<br />
	ArrayList parray = new ArrayList();<br />
	Person p = new Person();<br />
	p.setName(&#8220;VVVVVVV&#8221;);<br />
	p.setAge(23);<br />
	p.setGender(&#8216;m&#8217;);<br />
	p.setAddresses(aa);<br />
	PersistenceManager pm = PMF.get().getPersistenceManager();<br />
	pm.makePersistent(p);<br />
	pm.close();</p>
<p>by the looks of it &#8230; i am sure there is something very simple which i am missing but not able to put a finger to it.</p>
<p>Please help&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexander Arendar</title>
		<link>http://www.wetfeetblog.com/google-app-engine-java-jdo-inheritance-one-to-many-relationships/242/comment-page-1#comment-315</link>
		<dc:creator>Alexander Arendar</dc:creator>
		<pubDate>Mon, 15 Feb 2010 10:16:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.wetfeetblog.com/?p=242#comment-315</guid>
		<description>Thanks,

I already implemented this in that way.
I see those guys also got this problem trying to implement comments )))) Fun.

Alex</description>
		<content:encoded><![CDATA[<p>Thanks,</p>
<p>I already implemented this in that way.<br />
I see those guys also got this problem trying to implement comments )))) Fun.</p>
<p>Alex</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tomas</title>
		<link>http://www.wetfeetblog.com/google-app-engine-java-jdo-inheritance-one-to-many-relationships/242/comment-page-1#comment-304</link>
		<dc:creator>Tomas</dc:creator>
		<pubDate>Fri, 12 Feb 2010 18:39:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.wetfeetblog.com/?p=242#comment-304</guid>
		<description>&lt;a href=&quot;http://groups.google.com/group/google-appengine-java/browse_thread/thread/3affdf1441f864b6&quot; rel=&quot;nofollow&quot;&gt;here is the cause discussion on the topic&lt;/a&gt;

</description>
		<content:encoded><![CDATA[<p><a href="http://groups.google.com/group/google-appengine-java/browse_thread/thread/3affdf1441f864b6" rel="nofollow">here is the cause discussion on the topic</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tomas</title>
		<link>http://www.wetfeetblog.com/google-app-engine-java-jdo-inheritance-one-to-many-relationships/242/comment-page-1#comment-303</link>
		<dc:creator>Tomas</dc:creator>
		<pubDate>Fri, 12 Feb 2010 18:32:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.wetfeetblog.com/?p=242#comment-303</guid>
		<description>Yes, I think you are running into a limitation of big table JDO implementation. This creates kind of cyclic reference.
You will need to manage the relationship by hand on this one. Store a list of child keys to you can recreate the thread of comments. And have the parent for all comments be a thread, so you can pull them out in one query and contruct the thread by hand.
Some things are more work then you expect ;)</description>
		<content:encoded><![CDATA[<p>Yes, I think you are running into a limitation of big table JDO implementation. This creates kind of cyclic reference.<br />
You will need to manage the relationship by hand on this one. Store a list of child keys to you can recreate the thread of comments. And have the parent for all comments be a thread, so you can pull them out in one query and contruct the thread by hand.<br />
Some things are more work then you expect <img src='http://www.wetfeetblog.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexander Arendar</title>
		<link>http://www.wetfeetblog.com/google-app-engine-java-jdo-inheritance-one-to-many-relationships/242/comment-page-1#comment-302</link>
		<dc:creator>Alexander Arendar</dc:creator>
		<pubDate>Fri, 12 Feb 2010 17:56:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.wetfeetblog.com/?p=242#comment-302</guid>
		<description>Tomas,

could you help me a bit if you have time?
yesterday I was trying to model a simple forum comments. Just a
comments which you can add more comments to.
So, the approximation of the entity is like this:
-------------------------------------------------------------------
@PersistenceCapable (detachable = &quot;true&quot;, identityType =
IdentityType.APPLICATION)
public class CommentEntity {

       @PrimaryKey
       @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
       private Key key;

       @Persistent
       private String category;

       @Persistent
       private String commentDate;

       @Persistent
       private String userName;

       @Persistent
       private String commentBody;

       @Persistent
       private List children = new
ArrayList();

       getters/setters/etc.
}

DataNucleus enhancement goes ok, no errors in the console.
Call of the pm.makePersistent() goes without any exceptions for such
entity.
BUT IT IS NOT PERSISTED.

I found out that problem is in &quot;children&quot; property. And the problem is
it&#039;s a list of objects of the same class as the parent entity. If I
comment that property declaration the entity is persisted. Also if I
change the type of the child entities to some new class (not extending
the CommentEntity) it also gets persisted.

So my suspicion is that JDO (or GAE JDO impl) does not allow child
entities to be of the same class. Is it correct? Maybe I&#039;m missing
something essential? Please advice.</description>
		<content:encoded><![CDATA[<p>Tomas,</p>
<p>could you help me a bit if you have time?<br />
yesterday I was trying to model a simple forum comments. Just a<br />
comments which you can add more comments to.<br />
So, the approximation of the entity is like this:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
@PersistenceCapable (detachable = &#8220;true&#8221;, identityType =<br />
IdentityType.APPLICATION)<br />
public class CommentEntity {</p>
<p>       @PrimaryKey<br />
       @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)<br />
       private Key key;</p>
<p>       @Persistent<br />
       private String category;</p>
<p>       @Persistent<br />
       private String commentDate;</p>
<p>       @Persistent<br />
       private String userName;</p>
<p>       @Persistent<br />
       private String commentBody;</p>
<p>       @Persistent<br />
       private List children = new<br />
ArrayList();</p>
<p>       getters/setters/etc.<br />
}</p>
<p>DataNucleus enhancement goes ok, no errors in the console.<br />
Call of the pm.makePersistent() goes without any exceptions for such<br />
entity.<br />
BUT IT IS NOT PERSISTED.</p>
<p>I found out that problem is in &#8220;children&#8221; property. And the problem is<br />
it&#8217;s a list of objects of the same class as the parent entity. If I<br />
comment that property declaration the entity is persisted. Also if I<br />
change the type of the child entities to some new class (not extending<br />
the CommentEntity) it also gets persisted.</p>
<p>So my suspicion is that JDO (or GAE JDO impl) does not allow child<br />
entities to be of the same class. Is it correct? Maybe I&#8217;m missing<br />
something essential? Please advice.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
