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 件のコメント:

Timo Westkämper さんのコメント...

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.

Naoki Takezoe さんのコメント...

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.

Timo Westkämper さんのコメント...

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.

Naoki Takezoe さんのコメント...

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!

Timo Westkämper さんのコメント...
このコメントは投稿者によって削除されました。
Timo Westkämper さんのコメント...

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