Skip to end of metadata
Go to start of metadata

Version Status : 0.0.2 second release

Icon

Tested with Tapestry 5.2.x and 5.3.x

Introduction

The Tynamo Tapestry-JDO module allows you to work with a JDO3 (http://www.oracle.com/technetwork/java/index-jsp-135919.html) backed persistence layer, similarly to the way you would work w/ a JPA or Hibernate based persistence layer. JDO's main appeal is in its extensive support for ORM into relational databases (e.g. MySQL) as well as non-relational data stores (e.g. MongoDB through Datanucleus MongoDB Support, Google AppEngine JDO API, etc)

Configuration

In order to have a working configuration, the following are required:

  • A dependency on org.tynamo:tapestry-jdo
  • A JDO implementation (we use datanucleus in our examples, but others such as Apache JDO should work as well). The implementations typically have some way of integrating the JDO Enhancement process into the build; although not absolutely necessary (e.g. you could probably do that manually after you run your build and before packaging your app), it would probably be a good idea
  • A properly configured jdoconfig.xml or persistence.xml

Add dependency on Tapestry-JDO

Just adding this dependency will bring transitive dependency on jdo3.

 

Maven dependency for tapestry-jdo

Add your JDO implementation

Add your own dependencies for your JDO implementation if you're using something different:

 

JDO Implementation Dependencies

Configure build to instrument your JDO classes:

JDO Enhancer Configuration in Maven

 

Add your persistence store driver :

JDBC Driver Dependency

 

Setup your JDO configuration (jdoconfig.xml):

jdoconfig.xml

 

Contribute the PersistenceManagerFactory name to your AppModule:

Contribute Persistence Manager Factory name

 

Usage

 

Inject PersistenceManager into your pages:

Injecting JDO Persistence Manager

 

Auto-Commit in your pages

@CommitAfter in pages

 

Configure service transactional behavior

Service transactions

 

Use JDO object as page contex

Classes that use a simple primary key (e.g. Long, String, etc) can be used as an acitvation/passivation context directly

Activate/Passivate
  • No labels