Tynamo, JPA & GAE

Today I was playing with Tynamo & JPA and I found two things that I would like to share.

1) I wanted to check what was the simplest jpa configuration possible and I wanted to see how difficult is to migrate from tapestry-model-hibernate to tapestry-model-jpa using that configuration. It turns out that's really really easy.

  • Change your dependency from tapestry-model-hibernate to tapestry-model-jpa
  • Add hibernate-entitymanager as a dependency (don't forget to exclude slf4j-api)
  • Then configure your persistence.xml using org.hibernate.ejb.HibernatePersistence as a provider. You can even copy the properties from your hibernate.cfg.xml
  • Configure your persistence unit: configuration.add(JPASymbols.PERSISTENCE_UNIT, "nameOfPersistenceUnit");


THAT'S IT!!
More info: http://tynamo.org/tapestry-jpa+guide

2) I struggled with Google App Engine trying to run a very simple tapestry-model-jpa project. It took me a couple of painful tries to realize that GAE supports only JPA 1.0 (I knowwww!!! I should have RTFM!!!!).

Anyway, I'm not giving up on GAE, so next step: tapestry-model-objectify !

Click here to download:
persistence.xml (0 Bytes)
(download)