• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java EntityManagerFactoryBuilderImpl类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl的典型用法代码示例。如果您正苦于以下问题:Java EntityManagerFactoryBuilderImpl类的具体用法?Java EntityManagerFactoryBuilderImpl怎么用?Java EntityManagerFactoryBuilderImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



EntityManagerFactoryBuilderImpl类属于org.hibernate.jpa.boot.internal包,在下文中一共展示了EntityManagerFactoryBuilderImpl类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createContainerEntityManagerFactory

import org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl; //导入依赖的package包/类
/**
 * 2017-05-24 · reworked from SpringHibernateJpaPersistenceProvider so that we can inject a custom
 * {@link EntityManagerFactoryBuilderImpl}; previous implementation that overrides
 * {@link InterceptorAwareHibernatePersistenceProvider#getEntityManagerFactoryBuilder} no longer works
 * as there are several paths with various arguments and the overloaded one was no longer called.
 */
@Override
@SuppressWarnings("rawtypes")
public EntityManagerFactory createContainerEntityManagerFactory(PersistenceUnitInfo info, Map properties) {
	return new EntityManagerFactoryBuilderImpl(new PersistenceUnitInfoDescriptor(info), properties) {
		@Override
		protected void populate(SessionFactoryBuilder sfBuilder, StandardServiceRegistry ssr) {
			super.populate(sfBuilder, ssr);
			
			if (InterceptorAwareHibernatePersistenceProvider.this.interceptor != null) {
				LOGGER.warn("Installing our Spring managed interceptor.");
				sfBuilder.applyInterceptor(InterceptorAwareHibernatePersistenceProvider.this.interceptor);
			}
		}
	}.build();
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:22,代码来源:InterceptorAwareHibernatePersistenceProvider.java


示例2: test

import org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl; //导入依赖的package包/类
@Test
public void test() {
    PersistenceUnitInfoImpl persistenceUnitInfo = new PersistenceUnitInfoImpl(
            LongToNumericTypeTest.class.getName(),
            Collections.singletonList( Event.class.getName() ),
            validateProperties()
    );

    Map<String, Object> configuration = new HashMap<>();
    EntityManagerFactoryBuilderImpl entityManagerFactoryBuilder = new EntityManagerFactoryBuilderImpl(
            new PersistenceUnitInfoDescriptor( persistenceUnitInfo), configuration
    );
    EntityManagerFactory emf = null;
    try {
        emf = entityManagerFactoryBuilder.build();
    }
    finally {
        if ( emf != null ) {
            emf.close();
        }
    }
}
 
开发者ID:vladmihalcea,项目名称:high-performance-java-persistence,代码行数:23,代码来源:LongToNumericTypeTest.java


示例3: newEntityManagerFactory

import org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl; //导入依赖的package包/类
protected EntityManagerFactory newEntityManagerFactory() {
    PersistenceUnitInfo persistenceUnitInfo = persistenceUnitInfo(getClass().getSimpleName());
    Map<String, Object> configuration = new HashMap<>();
    configuration.put(AvailableSettings.INTERCEPTOR, interceptor());
    Integrator integrator = integrator();
    if (integrator != null) {
        configuration.put("hibernate.integrator_provider", (IntegratorProvider) () -> Collections.singletonList(integrator));
    }

    EntityManagerFactoryBuilderImpl entityManagerFactoryBuilder = new EntityManagerFactoryBuilderImpl(
            new PersistenceUnitInfoDescriptor(persistenceUnitInfo), configuration
    );
    return entityManagerFactoryBuilder.build();
}
 
开发者ID:vladmihalcea,项目名称:hibernate-types,代码行数:15,代码来源:AbstractTest.java


示例4: newEntityManagerFactory

import org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl; //导入依赖的package包/类
protected EntityManagerFactory newEntityManagerFactory() {
    PersistenceUnitInfo persistenceUnitInfo = persistenceUnitInfo(getClass().getSimpleName());
    Map<String, Object> configuration = new HashMap<String, Object>();

    EntityManagerFactoryBuilderImpl entityManagerFactoryBuilder = new EntityManagerFactoryBuilderImpl(
            new PersistenceUnitInfoDescriptor(persistenceUnitInfo), configuration
    );
    return entityManagerFactoryBuilder.build();
}
 
开发者ID:vladmihalcea,项目名称:hibernate-types,代码行数:10,代码来源:AbstractTest.java


示例5: newEntityManagerFactory

import org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl; //导入依赖的package包/类
protected EntityManagerFactory newEntityManagerFactory() {
    PersistenceUnitInfo persistenceUnitInfo = persistenceUnitInfo(getClass().getSimpleName());
    Map<String, Object> configuration = new HashMap<String, Object>();
    configuration.put(AvailableSettings.INTERCEPTOR, interceptor());
    Integrator integrator = integrator();

    EntityManagerFactoryBuilderImpl entityManagerFactoryBuilder = new EntityManagerFactoryBuilderImpl(
            new PersistenceUnitInfoDescriptor(persistenceUnitInfo), configuration
    );
    return entityManagerFactoryBuilder.build();
}
 
开发者ID:vladmihalcea,项目名称:hibernate-types,代码行数:12,代码来源:AbstractTest.java


示例6: createEntityManagerFactory

import org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl; //导入依赖的package包/类
/**
 * TODO : cache entity manager.
 *
 * @param info
 *            the info
 * @return the entity manager factory
 */
public static EntityManagerFactory createEntityManagerFactory(PersistenceUnitInfo info) {
	

	// Map<String, Object> integrationSettings = new HashMap<>();
	// integrationSettings.put(AvailableSettings.INTERCEPTOR, new
	// JKCustomSessionFactoryInterceptor());

	PersistenceUnitInfoDescriptor puDescriptor = new PersistenceUnitInfoDescriptor(info);
	EntityManagerFactoryBuilderImpl entityManagerFactoryBuilder = new EntityManagerFactoryBuilderImpl(puDescriptor, null);

	EntityManagerFactory emf = entityManagerFactoryBuilder.build();
	return emf;
}
 
开发者ID:kiswanij,项目名称:jk-db,代码行数:21,代码来源:JKEntityManagerFactory.java


示例7: createContainerEntityManagerFactory

import org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl; //导入依赖的package包/类
@Override
@SuppressWarnings("rawtypes")
public EntityManagerFactory createContainerEntityManagerFactory(PersistenceUnitInfo info, Map properties) {
	final List<String> mergedClassesAndPackages = new ArrayList<String>(info.getManagedClassNames());
	if (info instanceof SmartPersistenceUnitInfo) {
		mergedClassesAndPackages.addAll(((SmartPersistenceUnitInfo) info).getManagedPackages());
	}
	return new EntityManagerFactoryBuilderImpl(
			new PersistenceUnitInfoDescriptor(info) {
				@Override
				public List<String> getManagedClassNames() {
					return mergedClassesAndPackages;
				}
			}, properties).build();
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:16,代码来源:SpringHibernateJpaPersistenceProvider.java


示例8: entityManagerFactory

import org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl; //导入依赖的package包/类
@Component
public EntityManagerFactory entityManagerFactory () {
    PersistenceUnitInfo persistenceUnitInfo = persistenceUnitInfo();
    PersistenceUnitDescriptor descriptor = new PersistenceUnitInfoDescriptor(persistenceUnitInfo);
    EntityManagerFactoryBuilder entityManagerFactoryBuilder = new EntityManagerFactoryBuilderImpl(descriptor, null);
    return entityManagerFactoryBuilder.build();
}
 
开发者ID:ShotaOd,项目名称:carbon,代码行数:8,代码来源:HibernateConfiguration.java


示例9: newEntityManagerFactory

import org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl; //导入依赖的package包/类
protected EntityManagerFactory newEntityManagerFactory() {
    PersistenceUnitInfo persistenceUnitInfo = persistenceUnitInfo(getClass().getSimpleName());
    Map<String, Object> configuration = new HashMap<>();
    configuration.put(AvailableSettings.INTERCEPTOR, interceptor());
    Integrator integrator = integrator();
    if (integrator != null) {
        configuration.put("hibernate.integrator_provider", (IntegratorProvider) () -> Collections.singletonList(integrator));
    }

    EntityManagerFactoryBuilderImpl entityManagerFactoryBuilder = new EntityManagerFactoryBuilderImpl(
        new PersistenceUnitInfoDescriptor(persistenceUnitInfo), configuration
    );
    return entityManagerFactoryBuilder.build();
}
 
开发者ID:vladmihalcea,项目名称:high-performance-java-persistence,代码行数:15,代码来源:AbstractTest.java


示例10: getEntityManagerFactoryBuilderOrNull

import org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl; //导入依赖的package包/类
protected static EntityManagerFactoryBuilderImpl getEntityManagerFactoryBuilderOrNull(String persistenceUnitName, Map<String, Object> properties, ClassLoader providedClassLoader) {

		final Map<String, Object> integration = wrap( properties );
		final List<ParsedPersistenceXmlDescriptor> units;
		try {
			units = PersistenceXmlParser.locatePersistenceUnits( integration );
		}
		catch (Exception e) {
			throw new PersistenceException( "Unable to locate persistence units", e );
		}

		if ( persistenceUnitName == null && units.size() > 1 ) {
			throw new PersistenceException( "No name provided and multiple persistence units found" );
		}

		for ( ParsedPersistenceXmlDescriptor persistenceUnit : units ) {

			final boolean matches = persistenceUnitName == null || persistenceUnit.getName().equals( persistenceUnitName );
			if ( !matches ) {
				continue;
			}

			// See if we (Hibernate) are the persistence provider
			if ( ! ProviderChecker.isProvider( persistenceUnit, properties ) ) {
				continue;
			}

			return getEntityManagerFactoryBuilder( persistenceUnit, integration, providedClassLoader );
		}

		return null;
	}
 
开发者ID:premium-minds,项目名称:pm-persistence-utils,代码行数:33,代码来源:HibernateDDL.java


示例11: getConfiguration

import org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl; //导入依赖的package包/类
protected static Configuration getConfiguration(String unitName){
	EntityManagerFactoryBuilderImpl entityManagerFactoryBuilder = getEntityManagerFactoryBuilderOrNull(unitName, null);
	
	ServiceRegistry serviceRegistry = entityManagerFactoryBuilder.buildServiceRegistry();
	Configuration config = entityManagerFactoryBuilder.buildHibernateConfiguration(serviceRegistry);

	return config;
}
 
开发者ID:premium-minds,项目名称:pm-persistence-utils,代码行数:9,代码来源:HibernateDDL.java


示例12: newEntityManagerFactory

import org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl; //导入依赖的package包/类
protected EntityManagerFactory newEntityManagerFactory() {
    PersistenceUnitInfo persistenceUnitInfo = new PersistenceUnitInfoImpl(
        getClass().getSimpleName(), entityClassNames(), getProperties()
    );

    Map<String, Object> configuration = new HashMap<>();
    configuration.put(org.hibernate.jpa.AvailableSettings.INTERCEPTOR, interceptor());
    EntityManagerFactoryBuilderImpl entityManagerFactoryBuilder = new EntityManagerFactoryBuilderImpl(
        new PersistenceUnitInfoDescriptor(persistenceUnitInfo), configuration
    );
    return entityManagerFactoryBuilder.build();
}
 
开发者ID:vladmihalcea,项目名称:hibernate-master-class,代码行数:13,代码来源:AbstractTest.java


示例13: getEntityManagerFactoryBuilder

import org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl; //导入依赖的package包/类
protected static EntityManagerFactoryBuilderImpl getEntityManagerFactoryBuilder(PersistenceUnitDescriptor persistenceUnitDescriptor,
		Map<String, Object> integration, ClassLoader providedClassLoader) {
	return new EntityManagerFactoryBuilderImpl( persistenceUnitDescriptor, integration, providedClassLoader );
}
 
开发者ID:premium-minds,项目名称:pm-persistence-utils,代码行数:5,代码来源:HibernateDDL.java



注:本文中的org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BlockPrismarine类代码示例发布时间:2022-05-22
下一篇:
Java NewJavaProjectWizardPageOne类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap