Search in sources :

Example 1 with PersistenceDescriptorFactory

use of com.robo4j.db.sql.jpa.PersistenceDescriptorFactory in project robo4j by Robo4J.

the class PersistenceContextBuilder method build.

public PersistenceContextBuilder build() {
    PersistenceDescriptorFactory persistenceDescriptorFactory = new PersistenceDescriptorFactory();
    PersistenceUnitInfo persistenceUnitInfo = persistenceDescriptorFactory.get(RoboClassLoader.getInstance().getClassLoader(), sourceType, packages);
    PersistenceUnitDescriptor persistenceUnitDescriptor = new PersistenceUnitInfoDescriptor(persistenceUnitInfo);
    EntityManagerFactoryBuilder builder = new EntityManagerFactoryBuilderImpl(persistenceUnitDescriptor, new HashMap<>());
    registeredClasses = persistenceDescriptorFactory.registeredClasses();
    dataSourceContext = new DataSourceProxy(builder.build());
    return this;
}
Also used : PersistenceUnitInfoDescriptor(org.hibernate.jpa.boot.internal.PersistenceUnitInfoDescriptor) EntityManagerFactoryBuilderImpl(org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl) PersistenceUnitInfo(javax.persistence.spi.PersistenceUnitInfo) EntityManagerFactoryBuilder(org.hibernate.jpa.boot.spi.EntityManagerFactoryBuilder) PersistenceDescriptorFactory(com.robo4j.db.sql.jpa.PersistenceDescriptorFactory) PersistenceUnitDescriptor(org.hibernate.jpa.boot.spi.PersistenceUnitDescriptor)

Aggregations

PersistenceDescriptorFactory (com.robo4j.db.sql.jpa.PersistenceDescriptorFactory)1 PersistenceUnitInfo (javax.persistence.spi.PersistenceUnitInfo)1 EntityManagerFactoryBuilderImpl (org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl)1 PersistenceUnitInfoDescriptor (org.hibernate.jpa.boot.internal.PersistenceUnitInfoDescriptor)1 EntityManagerFactoryBuilder (org.hibernate.jpa.boot.spi.EntityManagerFactoryBuilder)1 PersistenceUnitDescriptor (org.hibernate.jpa.boot.spi.PersistenceUnitDescriptor)1