Tabnine Logo
JBossJpaServices
Code IndexAdd Tabnine to your IDE (free)

How to use
JBossJpaServices
in
org.jboss.weld.integration.persistence

Best Java code snippets using org.jboss.weld.integration.persistence.JBossJpaServices (Showing top 9 results out of 315)

origin: org.jboss.jbossas/weld-int-ejb

private PersistenceUnitDeployment lookupPersistenceUnitDeployment(String unitName)
{
 if (unitName == null)
 {
   throw new IllegalArgumentException("unitName is null");
 }
 String beanName = getPersistenceUnitSupplier(topLevelDeploymentUnit, persistenceUnitDependencyResolver, unitName);
 if (beanName == null)
 {
   throw new IllegalStateException("No persistence unit available for " + unitName);
 }
 return jbossEjb.lookupPersistenceUnitDeployment(beanName);
}
origin: org.jboss.jbossas/weld-int-ejb

@SuppressWarnings({"deprecation"})
private EntityManagerFactory resolvePersistenceUnit(String unitName)
{
 PersistenceUnitDeployment deployment = lookupPersistenceUnitDeployment(unitName);
 ManagedEntityManagerFactory managedFactory = deployment.getManagedFactory();
 return new InjectedEntityManagerFactory(managedFactory);
}
origin: org.jboss.weld.integration/weld-jboss-int-jboss-ejb

public EntityManager resolvePersistenceContext(InjectionPoint injectionPoint)
{
 if (!injectionPoint.getAnnotated().isAnnotationPresent(PersistenceContext.class))
 {
   throw new IllegalArgumentException("No @PersistenceContext annotation found on injection point " + injectionPoint);
 }
 if (injectionPoint.getMember() instanceof Method && ((Method) injectionPoint.getMember()).getParameterTypes().length != 1)
 {
   throw new IllegalArgumentException("Injection point represents a method which doesn't follow JavaBean conventions (must have exactly one parameter) " + injectionPoint);
 }
 try
 {
   return resolvePersistenceUnit((injectionPoint.getAnnotated().getAnnotation(PersistenceContext.class).unitName())).createEntityManager();
 }
 catch (IllegalStateException e)
 {
   throw new IllegalStateException("Unable to resolve persistence context for " + injectionPoint);
 }
}
origin: org.jboss.jbossas/weld-int-ejb

public EntityManagerFactory resolvePersistenceUnit(InjectionPoint injectionPoint)
{
 if (!injectionPoint.getAnnotated().isAnnotationPresent(PersistenceUnit.class))
 {
   throw new IllegalArgumentException("No @PersistenceUnit annotation found on injection point " + injectionPoint);
 }
 if (injectionPoint.getMember() instanceof Method && ((Method) injectionPoint.getMember()).getParameterTypes().length != 1)
 {
   throw new IllegalArgumentException("Injection point represents a method which doesn't follow JavaBean conventions (must have exactly one parameter) " + injectionPoint);
 }
 try
 {
   return resolvePersistenceUnit((injectionPoint.getAnnotated().getAnnotation(PersistenceUnit.class).unitName()));
 }
 catch (IllegalStateException e)
 {
   throw new IllegalStateException("Unable to resolve persistence context for " + injectionPoint);
 }
}
origin: org.jboss.weld.integration/weld-jboss-int-jboss-ejb

private EntityManagerFactory resolvePersistenceUnit(String unitName)
{
 if (unitName == null)
 {
   throw new IllegalArgumentException("unitName is null");
 }
 String beanName = getPersistenceUnitSupplier(topLevelDeploymentUnit, persistenceUnitDependencyResolver, unitName);
 if (beanName == null)
 {
   throw new IllegalStateException("No persistence unit available for " + unitName);
 }
 PersistenceUnitDeployment deployment = jbossEjb.lookupPersistenceUnitDeployment(beanName);
 ManagedEntityManagerFactory managedFactory = deployment.getManagedFactory();
 return new InjectedEntityManagerFactory(managedFactory);
}
origin: org.jboss.weld.integration/weld-jboss-int-jboss-ejb

public EntityManagerFactory resolvePersistenceUnit(InjectionPoint injectionPoint)
{
 if (!injectionPoint.getAnnotated().isAnnotationPresent(PersistenceUnit.class))
 {
   throw new IllegalArgumentException("No @PersistenceUnit annotation found on injection point " + injectionPoint);
 }
 if (injectionPoint.getMember() instanceof Method && ((Method) injectionPoint.getMember()).getParameterTypes().length != 1)
 {
   throw new IllegalArgumentException("Injection point represents a method which doesn't follow JavaBean conventions (must have exactly one parameter) " + injectionPoint);
 }
 try
 {
   return resolvePersistenceUnit((injectionPoint.getAnnotated().getAnnotation(PersistenceUnit.class).unitName()));
 }
 catch (IllegalStateException e)
 {
   throw new IllegalStateException("Unable to resolve persistence context for " + injectionPoint);
 }
}
origin: org.jboss.jbossas/weld-int-ejb

@SuppressWarnings({"deprecation"})
public EntityManager resolvePersistenceContext(InjectionPoint injectionPoint)
{
 if (!injectionPoint.getAnnotated().isAnnotationPresent(PersistenceContext.class))
 {
   throw new IllegalArgumentException("No @PersistenceContext annotation found on injection point " + injectionPoint);
 }
 if (injectionPoint.getMember() instanceof Method && ((Method) injectionPoint.getMember()).getParameterTypes().length != 1)
 {
   throw new IllegalArgumentException("Injection point represents a method which doesn't follow JavaBean conventions (must have exactly one parameter) " + injectionPoint);
 }
 try
 {
   String persistenceUnitName = injectionPoint.getAnnotated().getAnnotation(PersistenceContext.class).unitName();
   return new TransactionScopedEntityManager(lookupPersistenceUnitDeployment(persistenceUnitName).getManagedFactory());
 }
 catch (IllegalStateException e)
 {
   throw new IllegalStateException("Unable to resolve persistence context for " + injectionPoint);
 }
}
origin: org.jboss.jbossas/weld-int-ejb

  private static String getPersistenceUnitSupplier(DeploymentUnit deploymentUnit, PersistenceUnitDependencyResolver persistenceUnitDependencyResolver, String persistenceUnitName)
  {
   if ((deploymentUnit.getAttachment(AttachmentNames.PROCESSED_METADATA, JBossMetaData.class) != null && deploymentUnit.getAttachment(JBossMetaData.class).isEJB3x()) || (deploymentUnit.getAttachment(JBossWebMetaData.class) != null))
   {
     try
     {
      return persistenceUnitDependencyResolver.resolvePersistenceUnitSupplier(deploymentUnit, persistenceUnitName);
     }
     catch (IllegalArgumentException e)
     {
      // No-op, means we can't find the PU in this DU
     }
   }
   for (DeploymentUnit child : deploymentUnit.getChildren())
   {
     String beanName = getPersistenceUnitSupplier(child, persistenceUnitDependencyResolver, persistenceUnitName);
     if (beanName != null)
     {
      return beanName;
     }
   }
   return null;
  }
}
origin: org.jboss.weld.integration/weld-jboss-int-jboss-ejb

private static String getPersistenceUnitSupplier(DeploymentUnit deploymentUnit, PersistenceUnitDependencyResolver persistenceUnitDependencyResolver, String persistenceUnitName)
{
 if ((deploymentUnit.getAttachment(AttachmentNames.PROCESSED_METADATA, JBossMetaData.class) != null && deploymentUnit.getAttachment(JBossMetaData.class).isEJB3x()) || (deploymentUnit.getAttachment(JBossWebMetaData.class) != null))
 {
   try
   {
    return persistenceUnitDependencyResolver.resolvePersistenceUnitSupplier(deploymentUnit, persistenceUnitName);
   }
   catch (IllegalArgumentException e)
   {
    // No-op, means we can't find the PU in this DU
   }
 }
 for (DeploymentUnit child : deploymentUnit.getChildren())
 {
   String beanName = getPersistenceUnitSupplier(child, persistenceUnitDependencyResolver, persistenceUnitName);
   if (beanName != null)
   {
    return beanName;
   }
 }
 return null;
}
org.jboss.weld.integration.persistenceJBossJpaServices

Javadoc

JPA Weld Utitlies

Most used methods

  • getPersistenceUnitSupplier
  • resolvePersistenceUnit
  • lookupPersistenceUnitDeployment

Popular in Java

  • Reactive rest calls using spring rest template
  • putExtra (Intent)
  • addToBackStack (FragmentTransaction)
  • onRequestPermissionsResult (Fragment)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • Kernel (java.awt.image)
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • JPanel (javax.swing)
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Top PhpStorm 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