Class EntityManagerFactoryLocator

  • All Implemented Interfaces:
    Serializable, org.apache.wicket.proxy.IProxyTargetLocator, org.apache.wicket.util.io.IClusterable

    public class EntityManagerFactoryLocator
    extends Object
    implements org.apache.wicket.proxy.IProxyTargetLocator
    Implementation of IProxyTargetLocator to locate Java EE 5 EntityManagerFactory

    To use this technique in a Wicket Page, just insert a line like

    private @PersistenceUnit(unitName="defaultPersistenceContext") EntityManagerFactory emf;

    The 'unitName' attribute is mandatory, and refers to the name of the persistence unit you have declared in your persistence.xml file

    Author:
    Filippo Diotalevi
    See Also:
    Serialized Form
    • Constructor Detail

      • EntityManagerFactoryLocator

        public EntityManagerFactoryLocator​(String pUnit)
        Constructor
        Parameters:
        pUnit - - persistence unit
    • Method Detail

      • locateProxyTarget

        public Object locateProxyTarget()
        Specified by:
        locateProxyTarget in interface org.apache.wicket.proxy.IProxyTargetLocator
        See Also:
        IProxyTargetLocator.locateProxyTarget()
      • getPersistenceUnit

        public String getPersistenceUnit()