Hi,
As said in the message StreamingQueryResult (the result of your query)
doesn't itself implement the the Serializable interface that you have
for your own classes.
What you should do: defining your own class based on any Collection
your prefer (List, Vector, Map, etc.), make it implement Serializable
as you did for your other classes.
Then when you get a QueryResult, you loop into it to extract your own
object, put them in an instance of your collection class above and
ship it to client. That should work.
Anyway, it's better not to send instances of typical server side
objects like StreamingQueryResult to the client side.
regards
didier
On Mar 3, 10:36 am, andy wrote:
> My code here:
> Employee Class:
> @PersistenceCapable(identityType =
> IdentityType.APPLICATION,detachable="true")
> public class Employee implements Serializable {
> private static final long serialVersionUID = 1L;
>
> @PrimaryKey
> @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
> @Extension(vendorName="datanucleus", key="gae.encoded-pk",
> value="true")
> private String id;
> @Persistent
> private String ename;
>
> @Persistent
> private String designation;
> @Persistent(mappedBy="parentEmployee",defaultFetchGroup="true")
> private List leaves;
>
> @Persistent
> @Embedded
> private EmployeeManager employeeManager;
>
> }
>
> Leave Class:
> @PersistenceCapable(identityType =
> IdentityType.APPLICATION,detachable="true")
> public class Leave implements Serializable{
>
> private static final long serialVersionUID = 1L;
>
> @PrimaryKey
> @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
> @Extension(vendorName="datanucleus", key="gae.encoded-pk",
> value="true")
> private String leaveid;
>
> @Persistent
> private String reason;
>
> @Persistent
> private String status;
>
> // @OneToMany(fetch=FetchType.EAGER)
> public Employee parentEmployee;
>
> }
>
> EmployeeManager:
>
> @PersistenceCapable
> @EmbeddedOnly
> public class EmployeeManager implements Serializable {
> private static final long serialVersionUID = 1L;
>
> @Persistent
> public String managerId;
>
> }
>
> when i covert the result into String and then send to client then it is
> accepting but when i am sending object it giving me error like:
> Type 'org.datanucleus.store.appengine.query.StreamingQueryResult' 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.: instance =
> [parentemp.client.Employee@1988799, parentemp.client.Employee@ee738e,
> parentemp.client.Employee@e48ee2]
>
> What should i do...???
--
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.