Is there a way of converting dynamically an Entity to a specific
Object ?
For example:
I have some Contact objects and User, Invoice etc, witch are
PersistanceCapable.
So i can make queries (javax.jdo.Query) that return lists of those
kind of objects (Contact, User, Invoice etc) or i can use app engine
datastore.Query to get lists of Entity objects.
1. Is there a simple method of converting an Entity object to a
Contact for example? but without doing smth like :
        map = entitiy.getProperties();
        Contact c = new Contact();
        c.setProperty1(map.get("property1"));
        c.setProperty2(....)
        ... etc

      I want to know this because i want to use Query from the
datastore package and not javax.jdo and it doesn't seem a good
solution to make a method for each kind of entity. (I could use java
reflection to create the objects, but i think it is very complicated
since i don't know for example the types of fields and it is probably
a costly method).

2. Is the Query class form app engine datastore package more powerful
(or more suited) than the one from javax.jdo? Witch would you
recommend ?

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to