Package org.apache.deltaspike.jpa.api.entitymanager

Examples of org.apache.deltaspike.jpa.api.entitymanager.PersistenceUnitName


    @Produces
    @Dependent
    @PersistenceUnitName("any") // the value is nonbinding, thus 'any' is just a dummy parameter here
    public EntityManagerFactory createEntityManagerFactoryForUnit(InjectionPoint injectionPoint)
    {
        PersistenceUnitName unitNameAnnotation = injectionPoint.getAnnotated().getAnnotation(PersistenceUnitName.class);

        if (unitNameAnnotation == null)
        {
            LOG.warning("@PersisteneUnitName annotation could not be found at EntityManagerFactory injection point!");

            return null;
        }

        String unitName = unitNameAnnotation.value();

        Properties properties = persistenceConfigurationProvider.getEntityManagerFactoryConfiguration(unitName);

        EntityManagerFactory emf = Persistence.createEntityManagerFactory(unitName, properties);
View Full Code Here

TOP

Related Classes of org.apache.deltaspike.jpa.api.entitymanager.PersistenceUnitName

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.