org.compass.gps.device.jpa.lifecycle
Interface JpaEntityLifecycleInjector

All Known Implementing Classes:
EclipseLinkJpaEntityLifecycleInjector, HibernateJpaEntityCollectionLifecycleInjector, HibernateJpaEntityLifecycleInjector, OpenJPAJpaEntityLifecycleInjector, TopLinkEssentialsJpaEntityLifecycleInjector

public interface JpaEntityLifecycleInjector

A global lifecycle event listener injector. Since the EntityManagerFactory does not allow for setting global lifecycle event listeners, actual implementations of the JPA spec can be used directly to inject global lifecycle event listeners usign propriety APIs.

Assume that the EntityManagerFactory is the native one, since the NativeJpaExtractor of the JpaGpsDevice was used to extract it.

Author:
kimchy
See Also:
HibernateJpaEntityLifecycleInjector, JpaEntityLifecycleInjectorDetector

Method Summary
 void injectLifecycle(javax.persistence.EntityManagerFactory entityManagerFactory, JpaGpsDevice device)
          Injects a global lifecycle listener into the concrete EntityManagerFactory implementation.
 void removeLifecycle(javax.persistence.EntityManagerFactory entityManagerFactory, JpaGpsDevice device)
          Removes (if possible) lifecycle listeners injected using the inject method.
 

Method Detail

injectLifecycle

void injectLifecycle(javax.persistence.EntityManagerFactory entityManagerFactory,
                     JpaGpsDevice device)
                     throws JpaGpsDeviceException
Injects a global lifecycle listener into the concrete EntityManagerFactory implementation.

Parameters:
entityManagerFactory - The EntityManagerFactory to inject the global lifecycle to.
device - The Jpa device calling this injector
Throws:
JpaGpsDeviceException

removeLifecycle

void removeLifecycle(javax.persistence.EntityManagerFactory entityManagerFactory,
                     JpaGpsDevice device)
                     throws JpaGpsDeviceException
Removes (if possible) lifecycle listeners injected using the inject method.

Parameters:
entityManagerFactory - The EMF to remove lifecycle from
device - The Jpa device calling
Throws:
JpaGpsDeviceException


Copyright (c) 2004-2008 The Compass Project.