org.tynamo.jpa
Class JPAModule

java.lang.Object
  extended by org.tynamo.jpa.JPAModule

public class JPAModule
extends Object

Supplements the services defined by eu.cuetech.tapestry.jpa.JPACoreModule with additional services and configuration specific to Tapestry web application.


Constructor Summary
JPAModule()
           
 
Method Summary
static void contributeAlias(org.apache.tapestry5.ioc.Configuration<org.apache.tapestry5.services.AliasContribution> configuration, javax.persistence.EntityManager em)
          Contributes the package "<root>.entities" to the configuration, so that it will be scanned for annotated entity classes.
static void contributeComponentClassResolver(org.apache.tapestry5.ioc.Configuration<org.apache.tapestry5.services.LibraryMapping> configuration)
          Contribution to the ComponentClassResolver service configuration.
static void contributeComponentClassTransformWorker(org.apache.tapestry5.ioc.OrderedConfiguration<org.apache.tapestry5.services.ComponentClassTransformWorker> configuration)
          Adds the CommitAfter annotation work, to process the eu.cuetech.tapestry.jpa.annotations.CommitAfter annotation.
static void contributeFactoryDefaults(org.apache.tapestry5.ioc.MappedConfiguration<String,String> configuration)
           
static void contributePersistentFieldManager(org.apache.tapestry5.ioc.MappedConfiguration<String,org.apache.tapestry5.services.PersistentFieldStrategy> configuration)
          Contributes the following: entity Stores the id of the entity and reloads from the EntityManager
static void contributeValueEncoderSource(org.apache.tapestry5.ioc.MappedConfiguration<Class,org.apache.tapestry5.services.ValueEncoderFactory> configuration, boolean provideEncoders, JPAEntityManagerSource ems, javax.persistence.EntityManager em, org.apache.tapestry5.ioc.services.TypeCoercer typeCoercer, org.apache.tapestry5.ioc.services.PropertyAccess propertyAccess, org.apache.tapestry5.ioc.LoggerSource loggerSource)
          Contributes ValueEncoderFactorys for all registered JPA entity classes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JPAModule

public JPAModule()
Method Detail

contributeFactoryDefaults

public static void contributeFactoryDefaults(org.apache.tapestry5.ioc.MappedConfiguration<String,String> configuration)

contributeAlias

public static void contributeAlias(org.apache.tapestry5.ioc.Configuration<org.apache.tapestry5.services.AliasContribution> configuration,
                                   @JPACore
                                   javax.persistence.EntityManager em)
Contributes the package "<root>.entities" to the configuration, so that it will be scanned for annotated entity classes.

public static void contributeHibernateEntityPackageManager(Configuration configuration,


contributePersistentFieldManager

public static void contributePersistentFieldManager(org.apache.tapestry5.ioc.MappedConfiguration<String,org.apache.tapestry5.services.PersistentFieldStrategy> configuration)
Contributes the following:
entity
Stores the id of the entity and reloads from the EntityManager


contributeComponentClassTransformWorker

public static void contributeComponentClassTransformWorker(org.apache.tapestry5.ioc.OrderedConfiguration<org.apache.tapestry5.services.ComponentClassTransformWorker> configuration)
Adds the CommitAfter annotation work, to process the eu.cuetech.tapestry.jpa.annotations.CommitAfter annotation.


contributeComponentClassResolver

public static void contributeComponentClassResolver(org.apache.tapestry5.ioc.Configuration<org.apache.tapestry5.services.LibraryMapping> configuration)
Contribution to the ComponentClassResolver service configuration.


contributeValueEncoderSource

public static void contributeValueEncoderSource(org.apache.tapestry5.ioc.MappedConfiguration<Class,org.apache.tapestry5.services.ValueEncoderFactory> configuration,
                                                @Symbol(value="tapestry.jpa.provide-entity-value-encoders")
                                                boolean provideEncoders,
                                                JPAEntityManagerSource ems,
                                                javax.persistence.EntityManager em,
                                                org.apache.tapestry5.ioc.services.TypeCoercer typeCoercer,
                                                org.apache.tapestry5.ioc.services.PropertyAccess propertyAccess,
                                                org.apache.tapestry5.ioc.LoggerSource loggerSource)
Contributes ValueEncoderFactorys for all registered JPA entity classes. Encoding and decoding are based on the id property value of the entity using type coercion. Hence, if the id can be coerced to a String and back then the entity can be coerced.



Copyright © 2009-2010. All Rights Reserved.