2016/02/07 - Apache Onami has been retired.

For more information, please explore the Attic.

public abstract class

PersistenceModule

extends AbstractModule
java.lang.Object
   ↳ com.google.inject.AbstractModule
     ↳ org.apache.onami.persist.PersistenceModule

Class Overview

Main module of the onami persist guice extension.

Summary

Public Constructors
PersistenceModule()
Protected Methods
UnannotatedPersistenceUnitBuilder bindApplicationManagedPersistenceUnit(String puName)
Binds an application managed persistence unit.
UnannotatedPersistenceUnitBuilder bindContainerManagedPersistenceUnit(EntityManagerFactory emf)
Binds a container managed persistence unit for a given entity manager factory.
UnannotatedPersistenceUnitBuilder bindContainerManagedPersistenceUnitProvidedBy(Key<? extends Provider<EntityManagerFactory>> emfProviderKey)
Binds a container managed persistence unit.
UnannotatedPersistenceUnitBuilder bindContainerManagedPersistenceUnitProvidedBy(Provider<EntityManagerFactory> emfProvider)
Binds a container managed persistence unit.
UnannotatedPersistenceUnitBuilder bindContainerManagedPersistenceUnitProvidedBy(Class<? extends Provider<EntityManagerFactory>> emfProviderClass)
Binds a container managed persistence unit.
UnannotatedPersistenceUnitBuilder bindContainerManagedPersistenceUnitProvidedBy(TypeLiteral<? extends Provider<EntityManagerFactory>> emfProviderType)
Binds a container managed persistence unit.
UnannotatedPersistenceUnitBuilder bindContainerManagedPersistenceUnitWithJndiName(String jndiName)
Binds a container managed persistence unit.
final void configure()
abstract void configurePersistence()
Configures the persistence units over the exposed methods.
[Expand]
Inherited Methods
From class com.google.inject.AbstractModule
From class java.lang.Object
From interface com.google.inject.Module

Public Constructors

public PersistenceModule ()

Protected Methods

protected UnannotatedPersistenceUnitBuilder bindApplicationManagedPersistenceUnit (String puName)

Binds an application managed persistence unit.

Parameters
puName the name of the persistence unit as defined in the persistence.xml.
Returns
  • the next builder step.

protected UnannotatedPersistenceUnitBuilder bindContainerManagedPersistenceUnit (EntityManagerFactory emf)

Binds a container managed persistence unit for a given entity manager factory.

Parameters
emf the entity manager factory to use when creating new entity managers.
Returns
  • the next builder step.

protected UnannotatedPersistenceUnitBuilder bindContainerManagedPersistenceUnitProvidedBy (Key<? extends Provider<EntityManagerFactory>> emfProviderKey)

Binds a container managed persistence unit. The entity manager factory will be retrieved from the given provider.

Parameters
emfProviderKey the provider for the entity manager factory.
Returns
  • the next builder step.

protected UnannotatedPersistenceUnitBuilder bindContainerManagedPersistenceUnitProvidedBy (Provider<EntityManagerFactory> emfProvider)

Binds a container managed persistence unit. The entity manager factory will be retrieved from the given provider.

Parameters
emfProvider the provider for the entity manager factory.
Returns
  • the next builder step.

protected UnannotatedPersistenceUnitBuilder bindContainerManagedPersistenceUnitProvidedBy (Class<? extends Provider<EntityManagerFactory>> emfProviderClass)

Binds a container managed persistence unit. The entity manager factory will be retrieved from the given provider.

Parameters
emfProviderClass the provider for the entity manager factory.
Returns
  • the next builder step.

protected UnannotatedPersistenceUnitBuilder bindContainerManagedPersistenceUnitProvidedBy (TypeLiteral<? extends Provider<EntityManagerFactory>> emfProviderType)

Binds a container managed persistence unit. The entity manager factory will be retrieved from the given provider.

Parameters
emfProviderType the provider for the entity manager factory.
Returns
  • the next builder step.

protected UnannotatedPersistenceUnitBuilder bindContainerManagedPersistenceUnitWithJndiName (String jndiName)

Binds a container managed persistence unit. The entity manager factory will be retrieved from the JNDI context.

Parameters
jndiName the JNDI name of the entity manager factory.
Returns
  • the next builder step.

protected final void configure ()

protected abstract void configurePersistence ()

Configures the persistence units over the exposed methods.