1. you can also try AuDAO, which allows you to generate DAO layer over
GAE low-level datastore API. The DAO layer also includes the methods
for converting between DTO (e.g. Contact, User) and GAE Entity
objects, so you do not need to write them manually - they can be
generated. The way of conversion is the fastest one - no reflection is
used.
http://audao.spoledge.com

2. I think that the low-level API Query class is not so powerful as
the JDO's one - no "!=", "IN" nor ".contains()"... operands and
methods are supported. But it is probably faster - as it is the low-
level API which also the JDO framework probably uses.

Also in JDO you can dynamically construct queries using JDOQL. In low-
level API you must explicitly call method query.setFilter() for each
property.
So as a part of AuDAO we developed a free GQL parser (you can download
sources from the audao site). Using it, you can also create dynamic
low-level queries:
    Query lowLevelQuery  = new GqlDynamic().parseQuery( "SELECT * FROM
Contact WHERE firstName=:1 AND lastName=:2", "Jack", "Black");

Vaclav

On Feb 2, 12:08 pm, Alexandru Farcas <[email protected]> wrote:
> 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