hibernateJpaVendorAdapter.setDatabasePlatform(database.getDialect());
hibernateJpaVendorAdapter.setShowSql(false);
emf.setJpaVendorAdapter(hibernateJpaVendorAdapter);
// To search entity packages from other jar files..
emf.setPackagesToScan("empty");
emf.setPersistenceUnitPostProcessors(new PersistenceUnitPostProcessor() {
@Override
public void postProcessPersistenceUnitInfo(MutablePersistenceUnitInfo pui) {
Reflections reflections = new Reflections(ControllerConstants.DEFAULT_PACKAGE_NAME);
for (Class<?> each : reflections.getTypesAnnotatedWith(Entity.class)) {
LOGGER.trace("Entity class {} is detected as the SpringData entity.", each.getName());