Hi,

I have an entity called Node with attributes and the setters and getters for
them:
private int source;
private int graphId;
private Set<Integer> adjacentNodes;

In my servlet I have the following query:

Query query1= em.createQuery("SELECT x FROM pojos.Node x WHERE
graphId=:graph1Id");
query1.setParameter("graph1Id", g1Id);
List<Node> results1 = (List<Node>) query1.getResultList();

for(Node result1:results1){

            n1=result1.getSource();
            *g1AdjacentNodes =(Set<Integer>)(result1.getAdjacentNodes());*

}

Now, the line marked in bold, throws the exception :

java.lang.ClassCastException: java.lang.String cannot be cast to
java.lang.Long

Can someone please explain how to fix this?

Thanks,
Deepika

-- 
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-j...@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.

Reply via email to