Example usage for org.springframework.orm.jpa.persistenceunit PersistenceUnitPostProcessor postProcessPersistenceUnitInfo

List of usage examples for org.springframework.orm.jpa.persistenceunit PersistenceUnitPostProcessor postProcessPersistenceUnitInfo

Introduction

In this page you can find the example usage for org.springframework.orm.jpa.persistenceunit PersistenceUnitPostProcessor postProcessPersistenceUnitInfo.

Prototype

void postProcessPersistenceUnitInfo(MutablePersistenceUnitInfo pui);

Source Link

Document

Post-process the given PersistenceUnitInfo, for example registering further entity classes and jar files.

Usage

From source file:org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.java

/**
 * Hook method allowing subclasses to customize each PersistenceUnitInfo.
 * <p>The default implementation delegates to all registered PersistenceUnitPostProcessors.
 * It is usually preferable to register further entity classes, jar files etc there
 * rather than in a subclass of this manager, to be able to reuse the post-processors.
 * @param pui the chosen PersistenceUnitInfo, as read from {@code persistence.xml}.
 * Passed in as MutablePersistenceUnitInfo.
 * @see #setPersistenceUnitPostProcessors
 *//*  ww w  . j ava  2s  . c om*/
protected void postProcessPersistenceUnitInfo(MutablePersistenceUnitInfo pui) {
    PersistenceUnitPostProcessor[] postProcessors = getPersistenceUnitPostProcessors();
    if (postProcessors != null) {
        for (PersistenceUnitPostProcessor postProcessor : postProcessors) {
            postProcessor.postProcessPersistenceUnitInfo(pui);
        }
    }
}