[appengine-java] Fwd: One-To-Many RElations Serialization

2011-10-10 Thread Bruno Sandivilli
-- Forwarded message --
From: Bruno Sandivilli bruno.sandivi...@gmail.com
Date: 2011/10/10
Subject: Re: One-To-Many RElations Serialization
To: google-web-tool...@googlegroups.com


Thanks for the help from you guys!
But, yes im using IsSEriazeble. I've changed my code to detachable in both
classes, but, when i call:

if(listMyClass.size()  0)
 {
for (MyClass myClass : listMyClass) {
return (pm.detachCopy(myClass.getMyInnerClassList()));
 }
}
return null;


gives me : The class org.datanucleus.sco.backed.List is not persistable.
This means that it either hasnt been enhanced, or that the enhanced version
of the file is not in the CLASSPATH (or is hidden by an unenhanced version),
or the Meta-Data/annotations for the class are not found.


debugging this, i've reached this : assertClassPersistable in the class
ObjectMAnagerImpl. This function :

public void assertClassPersistable(Class cls)
{
if (cls != null 
!getOMFContext().getApiAdapter().isPersistable(cls)  !cls.isInterface())
{
throw new ClassNotPersistableException(cls.getName());
}
if (!hasPersistenceInformationForClass(cls))
{
throw new NoPersistenceInformationException(cls.getName());
}
}


2011/10/9 Brandon Donnelson branflake2...@gmail.com


 @PersistenceCapable(detachable=true)


 detached = pm.detachCopy(employee);


 Those will create a java.util List object. That should fix it.

 Brandon

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-web-toolkit/-/ikusuY9VjW0J.

 To post to this group, send email to google-web-tool...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Fwd: One-To-Many RElations Serialization

2011-10-07 Thread Bruno Sandivilli
-- Forwarded message --
From: Bruno Sandivilli bruno.sandivi...@gmail.com
Date: 2011/10/7
Subject: Re: One-To-Many RElations Serialization
To: google-web-tool...@googlegroups.com


PersistenceManager pm = PMF.get().getPersistenceManager();
javax.jdo.Query query = (javax.jdo.Query) pm.newQuery(Objetos.class);
 query.setFilter(name == nameParam);
query.declareParameters(String nameParam);
 ListMyInnerList listaMyInnerList = new ArrayListMyInnerList();
ListMyMain listaMyMainList  = (ListMyMain) query.execute(nameParam);
 if(listaMyMainList .size()  0)
{
listaMyInnerList.addAll(listaMyMainList.get(0).getMyInnerList());
 }
return new ArrayList(listaMyInnerList);
or
   return listaMyInnerList;
it gives the same error of Type 'org.datanucleus.sco.backed.ArrayList'

anyone?

2011/10/7 Bruno Sandivilli bruno.sandivi...@gmail.com

 Thanks Buddy!
 But if i'm not using Hibernate? I'm using pure GWT, do i have to use the
 filter in web.xml? How can i achieve this? Thanks


 2011/10/7 Juan Pablo Gardella gardellajuanpa...@gmail.com

 You can see the same problem but with hibernate 
 herehttp://code.google.com/intl/es/webtoolkit/articles/using_gwt_with_hibernate.html.
 In this page show some strategies to resolve the problem. In my case I don't
 adopt this strategies. I do a filter. In Pro Web 
 2.0http://books.google.com/books?id=OG816JSZYVcCpg=PA159lpg=PA159dq=gwt+hibernate+filtersource=blots=BM1JxFq0h9sig=gTKoh1ZBWs26d5vjRi-7CP4fo20hl=esei=R0OPTu_4GZC1hAfXmc32Dwsa=Xoi=book_resultct=resultresnum=7ved=0CF0Q6AEwBg#v=onepageq=gwt%20hibernate%20filterf=falseexplain
  the use of a
 *filter*. A class that, in your case, for example convert
 org.datanucleus.sco.backed.List in java.util.List. This filter intercept the
 classes before send to client. Here
 https://bitbucket.org/gardellajuanpablo/gwt-sample/src/8aba86d82778/src/main/java/com/foo/server/rpc/hibernate/HibernateFilter.javayou
 have an example of a Hibernate filter compatible with GWT 2.4.0 and how
 integrate in a sample project.

 Juan



 2011/10/7 Bruno Sandivilli bruno.sandivi...@gmail.com

 How can i serializa this ListMyClass ?


 2011/10/7 Juan Pablo Gardella gardellajuanpa...@gmail.com

 What's your question?

 2011/10/6 Bruno Sandivilli bruno.sandivi...@gmail.com

  I'm getting this error when my RPC returns a list of a custom object:
 Type 'org.datanucleus.sco.backed.List' was not included in the set of
 types which can be serialized by this SerializationPolicy or its Class
 object could not be loaded. For security purposes, this type will not be
 serialized.

 --
 You received this message because you are subscribed to the Google
 Groups Google Web Toolkit group.
 To post to this group, send email to
 google-web-tool...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.


  --
 You received this message because you are subscribed to the Google
 Groups Google Web Toolkit group.
 To post to this group, send email to
 google-web-tool...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-tool...@googlegroups.com
 .
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-tool...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.




-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-java@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.