Tabnine Logo
PersistenceAnnotationBeanPostProcessor.getPersistenceUnit
Code IndexAdd Tabnine to your IDE (free)

How to use
getPersistenceUnit
method
in
org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor

Best Java code snippets using org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.getPersistenceUnit (Showing top 9 results out of 315)

origin: spring-projects/spring-framework

private EntityManagerFactory resolveEntityManagerFactory(@Nullable String requestingBeanName) {
  // Obtain EntityManagerFactory from JNDI?
  EntityManagerFactory emf = getPersistenceUnit(this.unitName);
  if (emf == null) {
    // Need to search for EntityManagerFactory beans.
    emf = findEntityManagerFactory(this.unitName, requestingBeanName);
  }
  return emf;
}
origin: org.springframework/spring-orm

private EntityManagerFactory resolveEntityManagerFactory(@Nullable String requestingBeanName) {
  // Obtain EntityManagerFactory from JNDI?
  EntityManagerFactory emf = getPersistenceUnit(this.unitName);
  if (emf == null) {
    // Need to search for EntityManagerFactory beans.
    emf = findEntityManagerFactory(this.unitName, requestingBeanName);
  }
  return emf;
}
origin: spring-projects/spring-framework

  private EntityManager resolveExtendedEntityManager(Object target, @Nullable String requestingBeanName) {
    // Obtain EntityManager reference from JNDI?
    EntityManager em = getPersistenceContext(this.unitName, true);
    if (em == null) {
      // No pre-built EntityManager found -> build one based on factory.
      // Obtain EntityManagerFactory from JNDI?
      EntityManagerFactory emf = getPersistenceUnit(this.unitName);
      if (emf == null) {
        // Need to search for EntityManagerFactory beans.
        emf = findEntityManagerFactory(this.unitName, requestingBeanName);
      }
      // Inject a container-managed extended EntityManager.
      em = ExtendedEntityManagerCreator.createContainerManagedEntityManager(
          emf, this.properties, this.synchronizedWithTransaction);
    }
    if (em instanceof EntityManagerProxy && beanFactory != null && requestingBeanName != null &&
        beanFactory.containsBean(requestingBeanName) && !beanFactory.isPrototype(requestingBeanName)) {
      extendedEntityManagersToClose.put(target, ((EntityManagerProxy) em).getTargetEntityManager());
    }
    return em;
  }
}
origin: spring-projects/spring-framework

private EntityManager resolveEntityManager(@Nullable String requestingBeanName) {
  // Obtain EntityManager reference from JNDI?
  EntityManager em = getPersistenceContext(this.unitName, false);
  if (em == null) {
    // No pre-built EntityManager found -> build one based on factory.
    // Obtain EntityManagerFactory from JNDI?
    EntityManagerFactory emf = getPersistenceUnit(this.unitName);
    if (emf == null) {
      // Need to search for EntityManagerFactory beans.
      emf = findEntityManagerFactory(this.unitName, requestingBeanName);
    }
    // Inject a shared transactional EntityManager proxy.
    if (emf instanceof EntityManagerFactoryInfo &&
        ((EntityManagerFactoryInfo) emf).getEntityManagerInterface() != null) {
      // Create EntityManager based on the info's vendor-specific type
      // (which might be more specific than the field's type).
      em = SharedEntityManagerCreator.createSharedEntityManager(
          emf, this.properties, this.synchronizedWithTransaction);
    }
    else {
      // Create EntityManager based on the field's type.
      em = SharedEntityManagerCreator.createSharedEntityManager(
          emf, this.properties, this.synchronizedWithTransaction, getResourceType());
    }
  }
  return em;
}
origin: org.springframework/spring-orm

  private EntityManager resolveExtendedEntityManager(Object target, @Nullable String requestingBeanName) {
    // Obtain EntityManager reference from JNDI?
    EntityManager em = getPersistenceContext(this.unitName, true);
    if (em == null) {
      // No pre-built EntityManager found -> build one based on factory.
      // Obtain EntityManagerFactory from JNDI?
      EntityManagerFactory emf = getPersistenceUnit(this.unitName);
      if (emf == null) {
        // Need to search for EntityManagerFactory beans.
        emf = findEntityManagerFactory(this.unitName, requestingBeanName);
      }
      // Inject a container-managed extended EntityManager.
      em = ExtendedEntityManagerCreator.createContainerManagedEntityManager(
          emf, this.properties, this.synchronizedWithTransaction);
    }
    if (em instanceof EntityManagerProxy && beanFactory != null && requestingBeanName != null &&
        beanFactory.containsBean(requestingBeanName) && !beanFactory.isPrototype(requestingBeanName)) {
      extendedEntityManagersToClose.put(target, ((EntityManagerProxy) em).getTargetEntityManager());
    }
    return em;
  }
}
origin: org.springframework/spring-orm

private EntityManager resolveEntityManager(@Nullable String requestingBeanName) {
  // Obtain EntityManager reference from JNDI?
  EntityManager em = getPersistenceContext(this.unitName, false);
  if (em == null) {
    // No pre-built EntityManager found -> build one based on factory.
    // Obtain EntityManagerFactory from JNDI?
    EntityManagerFactory emf = getPersistenceUnit(this.unitName);
    if (emf == null) {
      // Need to search for EntityManagerFactory beans.
      emf = findEntityManagerFactory(this.unitName, requestingBeanName);
    }
    // Inject a shared transactional EntityManager proxy.
    if (emf instanceof EntityManagerFactoryInfo &&
        ((EntityManagerFactoryInfo) emf).getEntityManagerInterface() != null) {
      // Create EntityManager based on the info's vendor-specific type
      // (which might be more specific than the field's type).
      em = SharedEntityManagerCreator.createSharedEntityManager(
          emf, this.properties, this.synchronizedWithTransaction);
    }
    else {
      // Create EntityManager based on the field's type.
      em = SharedEntityManagerCreator.createSharedEntityManager(
          emf, this.properties, this.synchronizedWithTransaction, getResourceType());
    }
  }
  return em;
}
origin: apache/servicemix-bundles

private EntityManagerFactory resolveEntityManagerFactory(@Nullable String requestingBeanName) {
  // Obtain EntityManagerFactory from JNDI?
  EntityManagerFactory emf = getPersistenceUnit(this.unitName);
  if (emf == null) {
    // Need to search for EntityManagerFactory beans.
    emf = findEntityManagerFactory(this.unitName, requestingBeanName);
  }
  return emf;
}
origin: apache/servicemix-bundles

  private EntityManager resolveExtendedEntityManager(Object target, @Nullable String requestingBeanName) {
    // Obtain EntityManager reference from JNDI?
    EntityManager em = getPersistenceContext(this.unitName, true);
    if (em == null) {
      // No pre-built EntityManager found -> build one based on factory.
      // Obtain EntityManagerFactory from JNDI?
      EntityManagerFactory emf = getPersistenceUnit(this.unitName);
      if (emf == null) {
        // Need to search for EntityManagerFactory beans.
        emf = findEntityManagerFactory(this.unitName, requestingBeanName);
      }
      // Inject a container-managed extended EntityManager.
      em = ExtendedEntityManagerCreator.createContainerManagedEntityManager(
          emf, this.properties, this.synchronizedWithTransaction);
    }
    if (em instanceof EntityManagerProxy && beanFactory != null && requestingBeanName != null &&
        beanFactory.containsBean(requestingBeanName) && !beanFactory.isPrototype(requestingBeanName)) {
      extendedEntityManagersToClose.put(target, ((EntityManagerProxy) em).getTargetEntityManager());
    }
    return em;
  }
}
origin: apache/servicemix-bundles

private EntityManager resolveEntityManager(@Nullable String requestingBeanName) {
  // Obtain EntityManager reference from JNDI?
  EntityManager em = getPersistenceContext(this.unitName, false);
  if (em == null) {
    // No pre-built EntityManager found -> build one based on factory.
    // Obtain EntityManagerFactory from JNDI?
    EntityManagerFactory emf = getPersistenceUnit(this.unitName);
    if (emf == null) {
      // Need to search for EntityManagerFactory beans.
      emf = findEntityManagerFactory(this.unitName, requestingBeanName);
    }
    // Inject a shared transactional EntityManager proxy.
    if (emf instanceof EntityManagerFactoryInfo &&
        ((EntityManagerFactoryInfo) emf).getEntityManagerInterface() != null) {
      // Create EntityManager based on the info's vendor-specific type
      // (which might be more specific than the field's type).
      em = SharedEntityManagerCreator.createSharedEntityManager(
          emf, this.properties, this.synchronizedWithTransaction);
    }
    else {
      // Create EntityManager based on the field's type.
      em = SharedEntityManagerCreator.createSharedEntityManager(
          emf, this.properties, this.synchronizedWithTransaction, getResourceType());
    }
  }
  return em;
}
org.springframework.orm.jpa.supportPersistenceAnnotationBeanPostProcessorgetPersistenceUnit

Javadoc

Return a specified persistence unit for the given unit name, as defined through the "persistenceUnits" map.

Popular methods of PersistenceAnnotationBeanPostProcessor

  • <init>
  • buildPersistenceMetadata
  • findDefaultEntityManagerFactory
    Find a single default EntityManagerFactory in the Spring application context.
  • findEntityManagerFactory
    Find an EntityManagerFactory with the given name in the current Spring application context, falling
  • findNamedEntityManagerFactory
    Find an EntityManagerFactory with the given name in the current Spring application context.
  • findPersistenceMetadata
  • getPersistenceContext
    Return a specified persistence context for the given unit name, as defined through the "persistenceC
  • lookup
    Perform a JNDI lookup for the given resource by name.Called for EntityManagerFactory and EntityManag
  • postProcessProperties
  • postProcessMergedBeanDefinition
  • setDefaultPersistenceUnitName
    Specify the default persistence unit name, to be used in case of no unit name specified in an @Persi
  • setExtendedPersistenceContexts
    Specify the extended persistence contexts for EntityManager lookups, as a Map from persistence unit
  • setDefaultPersistenceUnitName,
  • setExtendedPersistenceContexts,
  • setJndiTemplate,
  • setPersistenceContexts,
  • setPersistenceUnits

Popular in Java

  • Parsing JSON documents to java classes using gson
  • requestLocationUpdates (LocationManager)
  • getSharedPreferences (Context)
  • setRequestProperty (URLConnection)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • ImageIO (javax.imageio)
  • Option (scala)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now