org.hibernate.jpa.boot.spi.Bootstrap类的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(7.8k)|赞(0)|评价(0)|浏览(122)

本文整理了Java中org.hibernate.jpa.boot.spi.Bootstrap类的一些代码示例,展示了Bootstrap类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bootstrap类的具体详情如下:
包路径:org.hibernate.jpa.boot.spi.Bootstrap
类名称:Bootstrap

Bootstrap介绍

[英]Entry into the bootstrap process.
[中]进入引导过程。

代码示例

代码示例来源:origin: hibernate/hibernate-orm

@SuppressWarnings("WeakerAccess")
public TwoPhaseBootstrapImpl(final PersistenceUnitInfo info, final Map map) {
  entityManagerFactoryBuilder =
      Bootstrap.getEntityManagerFactoryBuilder( info, map );
}

代码示例来源:origin: hibernate/hibernate-orm

protected EntityManagerFactoryBuilder getEntityManagerFactoryBuilder(PersistenceUnitDescriptor persistenceUnitDescriptor,
    Map integration, ClassLoader providedClassLoader) {
  return Bootstrap.getEntityManagerFactoryBuilder( persistenceUnitDescriptor, integration, providedClassLoader );
}

代码示例来源:origin: hibernate/hibernate-orm

protected EntityManagerFactoryBuilder getEntityManagerFactoryBuilder(PersistenceUnitDescriptor persistenceUnitDescriptor,
    Map integration, ClassLoaderService providedClassLoaderService) {
  return Bootstrap.getEntityManagerFactoryBuilder( persistenceUnitDescriptor, integration, providedClassLoaderService );
}

代码示例来源:origin: hibernate/hibernate-orm

protected EntityManagerFactoryBuilder getEntityManagerFactoryBuilder(PersistenceUnitInfo info, Map integration) {
  return Bootstrap.getEntityManagerFactoryBuilder( info, integration );
}

代码示例来源:origin: hibernate/hibernate-orm

/**
 * Intended for use in Hibernate tests
 *
 * @param persistenceXmlUrl The URL to a persistence.xml
 * @param persistenceUnitName The name of the persistence-unit to parse
 * @param integration setting overrides
 *
 * @return The EMFB
 */
public static EntityManagerFactoryBuilder getEntityManagerFactoryBuilder(
    URL persistenceXmlUrl,
    String persistenceUnitName,
    Map integration) {
  return getEntityManagerFactoryBuilder( persistenceXmlUrl, persistenceUnitName, PersistenceUnitTransactionType.RESOURCE_LOCAL, integration );
}

代码示例来源:origin: wildfly/wildfly

public TwoPhaseBootstrapImpl(final PersistenceUnitInfo info, final Map map) {
  entityManagerFactoryBuilder =
        Bootstrap.getEntityManagerFactoryBuilder(info, map);
}

代码示例来源:origin: wildfly/wildfly

public TwoPhaseBootstrapImpl(final PersistenceUnitInfo info, final Map map) {
  entityManagerFactoryBuilder =
        Bootstrap.getEntityManagerFactoryBuilder(info, map);
}

代码示例来源:origin: wildfly/wildfly

public TwoPhaseBootstrapImpl(final PersistenceUnitInfo info, final Map map) {
  entityManagerFactoryBuilder =
        Bootstrap.getEntityManagerFactoryBuilder(info, map);
}

代码示例来源:origin: hibernate/hibernate-orm

public static EntityManagerFactoryBuilder getEntityManagerFactoryBuilder(
      PersistenceUnitInfo persistenceUnitInfo,
      Map integration,
      ClassLoaderService providedClassLoaderService) {
    return getEntityManagerFactoryBuilder( new PersistenceUnitInfoDescriptor( persistenceUnitInfo ), integration, providedClassLoaderService );
  }
}

代码示例来源:origin: hibernate/hibernate-orm

public static EntityManagerFactoryBuilder getEntityManagerFactoryBuilder(
    PersistenceUnitInfo persistenceUnitInfo,
    Map integration,
    ClassLoader providedClassLoader) {
  return getEntityManagerFactoryBuilder( new PersistenceUnitInfoDescriptor( persistenceUnitInfo ), integration, providedClassLoader );
}

代码示例来源:origin: hibernate/hibernate-orm

@Override
@SuppressWarnings("unchecked")
public EntityManagerFactory createContainerEntityManagerFactory(PersistenceUnitInfo info, Map properties) {
  final Map settings = generateSettings( properties );
  // OSGi ClassLoaders must implement BundleReference
  settings.put(
      org.hibernate.cfg.AvailableSettings.SCANNER,
      new OsgiScanner( ( (BundleReference) info.getClassLoader() ).getBundle() )
  );
  osgiClassLoader.addClassLoader( info.getClassLoader() );
  
  return Bootstrap.getEntityManagerFactoryBuilder( info, settings,
      new OSGiClassLoaderServiceImpl( osgiClassLoader, osgiServiceUtil ) ).build();
}

代码示例来源:origin: hibernate/hibernate-orm

@Test
  public void testCreateThenDrop() throws Exception {
    URL persistenceXmlUrl = Thread.currentThread().getContextClassLoader().getResource( PERSISTENCE_XML_RESOURCE_NAME );
    if ( persistenceXmlUrl == null ) {
      persistenceXmlUrl = Thread.currentThread().getContextClassLoader().getResource( '/' + PERSISTENCE_XML_RESOURCE_NAME );
    }

    assertNotNull( persistenceXmlUrl );

    ParsedPersistenceXmlDescriptor persistenceUnit = PersistenceXmlParser.locateIndividualPersistenceUnit( persistenceXmlUrl );
    // creating the EMF causes SchemaCreator to be run...
    EntityManagerFactory emf = Bootstrap.getEntityManagerFactoryBuilder( persistenceUnit, Collections.emptyMap() ).build();

    // closing the EMF causes the delayed SchemaDropper to be run...
    //		wrap in a transaction just to see if we can get this to fail in the way the WF report says;
    //		in my experience however this succeeds with or without the transaction
    final TransactionManager tm = emf.unwrap( SessionFactoryImplementor.class ).getServiceRegistry().getService( JtaPlatform.class ).retrieveTransactionManager();

    tm.begin();
    Transaction txn = tm.getTransaction();
    emf.close();
    txn.commit();
  }
}

代码示例来源:origin: hibernate/hibernate-orm

protected void init(boolean audited, String auditStrategy) throws IOException {
  this.audited = audited;
  Properties configurationProperties = new Properties();
  configurationProperties.putAll( Environment.getProperties() );
  if ( !audited ) {
    configurationProperties.setProperty( EnversIntegrator.AUTO_REGISTER, "false" );
  }
  if ( createSchema() ) {
    configurationProperties.setProperty( Environment.HBM2DDL_AUTO, "create-drop" );
    configurationProperties.setProperty( Environment.USE_NEW_ID_GENERATOR_MAPPINGS, "true" );
    configurationProperties.setProperty( EnversSettings.USE_REVISION_ENTITY_WITH_NATIVE_ID, "false" );
  }
  if ( auditStrategy != null && !"".equals( auditStrategy ) ) {
    configurationProperties.setProperty( "org.hibernate.envers.audit_strategy", auditStrategy );
  }
  addConfigurationProperties( configurationProperties );
  configurationProperties.put( AvailableSettings.LOADED_CLASSES, Arrays.asList( getAnnotatedClasses() ) );
  entityManagerFactoryBuilder = (EntityManagerFactoryBuilderImpl) Bootstrap.getEntityManagerFactoryBuilder(
      new PersistenceUnitDescriptorAdapter(),
      configurationProperties
  );
  emf = entityManagerFactoryBuilder.build().unwrap( HibernateEntityManagerFactory.class );
  serviceRegistry = (StandardServiceRegistryImpl) emf.getSessionFactory()
      .getServiceRegistry()
      .getParentServiceRegistry();
  newEntityManager();
}

代码示例来源:origin: hibernate/hibernate-orm

"none"
);
entityManagerFactory =  Bootstrap.getEntityManagerFactoryBuilder(
    new TestingPersistenceUnitDescriptorImpl( getClass().getSimpleName() ),
    settings

代码示例来源:origin: hibernate/hibernate-orm

@BeforeClassOnce
@SuppressWarnings({"UnusedDeclaration"})
public void buildEntityManagerFactory() throws Exception {
  log.trace( "Building EntityManagerFactory" );
  entityManagerFactoryBuilder = (EntityManagerFactoryBuilderImpl) Bootstrap.getEntityManagerFactoryBuilder(
      buildPersistenceUnitDescriptor(),
      buildSettings()
  );
  entityManagerFactory = entityManagerFactoryBuilder.build().unwrap( SessionFactoryImplementor.class );
  serviceRegistry = (StandardServiceRegistryImpl) entityManagerFactory.getServiceRegistry()
      .getParentServiceRegistry();
  afterEntityManagerFactoryBuilt();
}

代码示例来源:origin: hibernate/hibernate-orm

);
entityManagerFactory =  Bootstrap
.getEntityManagerFactoryBuilder(
  new TestingPersistenceUnitDescriptorImpl( getClass().getSimpleName() ),
  settings )

代码示例来源:origin: hibernate/hibernate-orm

"update"
);
entityManagerFactory =  Bootstrap.getEntityManagerFactoryBuilder(
    new TestingPersistenceUnitDescriptorImpl( getClass().getSimpleName() ),
    settings

代码示例来源:origin: hibernate/hibernate-orm

"update"
);
entityManagerFactory =  Bootstrap.getEntityManagerFactoryBuilder(
  new TestingPersistenceUnitDescriptorImpl( getClass().getSimpleName() ),
  settings

代码示例来源:origin: org.jboss.eap/jipijapa-hibernate4-3

public TwoPhaseBootstrapImpl(final PersistenceUnitInfo info, final Map map) {
  entityManagerFactoryBuilder =
        Bootstrap.getEntityManagerFactoryBuilder(info, map);
}

代码示例来源:origin: org.hibernate.orm/hibernate-core

protected EntityManagerFactoryBuilder getEntityManagerFactoryBuilder(PersistenceUnitInfo info, Map integration) {
  return Bootstrap.getEntityManagerFactoryBuilder( info, integration );
}

相关文章

微信公众号

最新文章

更多