7/26/2009

Utility to use JDO easily on Google App Engine

We can use JDO to access BigTable on Google App Engine for Java.

However JDO PersistenceManager and Query object are so complex. So I wrote an utility to use JDO easily. For example, you can search entities as follows instead of JDO Query object.

List entries = JdoUtil.from(Entry.class)
  .filter("userId == ?")
  .ordering("updateDate desc")
  .range(0, 20)
  .getResultList(userId); 

No need to cast result objects and Query#declareParameters() also.

I would like to provide this utility in the part of my NikoNiko Framework (NikoNiko means Smile in Japanese). NikoNiko Framework supports both standard JavaEE web development and Google App Engine for Java. It's small and lightweight. It would be suitable for the small web application development.

6 件のコメント:

  1. If you want to get even further with simplifying JDO usage, consider using Querydsl. In addition to JDO, Querydsl supports SQL, JPA and Java collections.

    We are closely working with the JDO group to ensure that Querydsl is expressive as possible for JDOQL queries.

    返信削除
  2. Thanks, I will check it!
    However I'm assuming this utility are used in Google App Engine. I think Querydsl might be not able to work in Google App Engine.

    返信削除
  3. I see no reasons why it wouldn't work. You can use both JPA and JDO as APIs for Querydsl.

    I haven't tried it though.

    返信削除
  4. Thanks Timo.
    I didn't understand Querydsl well. I checked it and I think it's powerful solution on also Google App Engine to assemble query type safety and intuitive!

    返信削除
  5. このコメントは投稿者によって削除されました。

    返信削除
  6. Thanks Naoki.

    If you end up using Querydsl feel free to contact me if you run into any troubles.

    Our forum is also a good place to ask questions : Mysema Source forum

    返信削除