Package javax.persistence

Examples of javax.persistence.PersistenceContext.unitName()


        } else if ( annotatedField.isAnnotationPresent( PersistenceUnit.class ) ) {
            PersistenceUnit persistenceUnit = annotatedField.getAnnotation( PersistenceUnit.class );
            lookupName = getJndiName( persistenceUnit.unitName(), null, persistenceUnit.name() );
        } else if ( annotatedField.isAnnotationPresent( PersistenceContext.class ) ) {
            PersistenceContext persistenceContext = annotatedField.getAnnotation( PersistenceContext.class );
            lookupName = getJndiName( persistenceContext.unitName(), null, persistenceContext.name() );
        }

        if ( lookupName == null || lookupName.trim().length() == 0 ) {
            lookupName = getComponentEnvName( annotatedClass,
                                              annotatedField.getJavaMember().getName(),
View Full Code Here


        //TODO: cache this stuff
        final PersistenceContext context = injectionPoint.getAnnotated().getAnnotation(PersistenceContext.class);
        if(context == null) {
            throw new RuntimeException("Could not find @PersistenceContext annotation on " + injectionPoint.getMember());
        }
        final String scopedPuName = getScopedPUName(deploymentUnit, context.unitName());
        final ServiceName persistenceUnitServiceName = PersistenceUnitService.getPUServiceName(scopedPuName);

        final ServiceController<?> serviceController = serviceRegistry.getRequiredService(persistenceUnitServiceName);
        //now we have the service controller, as this method is only called at runtime the service should
        //always be up
View Full Code Here

       
        annot = AnnotationUtil.getAnnotation(annotations, PersistenceContext.class);
        if (annot != null)
        {
            PersistenceContext pc = (PersistenceContext) annot;
            String unitName = pc.unitName();
            String name = pc.name();
           
            //X TODO what if the EntityManager is null?
            return getJPAService().getPersistenceContext(unitName, name);
        }
View Full Code Here

       
        if (field.isAnnotationPresent(PersistenceContext.class))
        {
            PersistenceContext annotation = field.getAnnotation(PersistenceContext.class);
           
            return this.jpaService.getPersistenceContext(annotation.unitName());
           
        }
       
        if (field.isAnnotationPresent(PersistenceUnit.class))
        {
View Full Code Here

       
        if (field.isAnnotationPresent(PersistenceUnit.class))
        {
            PersistenceUnit annotation = field.getAnnotation(PersistenceUnit.class);
           
            return this.jpaService.getPersistenceUnit(annotation.unitName());
        }
       
        return null;
    }
View Full Code Here

        } else if ( annotatedField.isAnnotationPresent( PersistenceUnit.class ) ) {
            PersistenceUnit persistenceUnit = annotatedField.getAnnotation( PersistenceUnit.class );
            lookupName = getJndiName( persistenceUnit.unitName(), null, persistenceUnit.name() );
        } else if ( annotatedField.isAnnotationPresent( PersistenceContext.class ) ) {
            PersistenceContext persistenceContext = annotatedField.getAnnotation( PersistenceContext.class );
            lookupName = getJndiName( persistenceContext.unitName(), null, persistenceContext.name() );
        }

        if ( lookupName == null || lookupName.trim().length() == 0 ) {
            lookupName = getComponentEnvName( annotatedClass,
                                              annotatedField.getJavaMember().getName(),
View Full Code Here

        } else if ( annotatedField.isAnnotationPresent( PersistenceUnit.class ) ) {
            PersistenceUnit persistenceUnit = annotatedField.getAnnotation( PersistenceUnit.class );
            lookupName = getJndiName( persistenceUnit.unitName(), null, persistenceUnit.name() );
        } else if ( annotatedField.isAnnotationPresent( PersistenceContext.class ) ) {
            PersistenceContext persistenceContext = annotatedField.getAnnotation( PersistenceContext.class );
            lookupName = getJndiName( persistenceContext.unitName(), null, persistenceContext.name() );
        }

        if ( lookupName == null || lookupName.trim().length() == 0 ) {
            lookupName = getComponentEnvName( annotatedClass,
                                              annotatedField.getJavaMember().getName(),
View Full Code Here

          properties = new Properties();
          for (PersistenceProperty pp : pps) {
            properties.setProperty(pp.name(), pp.value());
          }
        }
        this.unitName = pc.unitName();
        this.type = pc.type();
        this.synchronizedWithTransaction = (synchronizationAttribute == null ||
            "SYNCHRONIZED".equals(ReflectionUtils.invokeMethod(synchronizationAttribute, pc).toString()));
        this.properties = properties;
      }
View Full Code Here

        //TODO: cache this stuff
        final PersistenceContext context = injectionPoint.getAnnotated().getAnnotation(PersistenceContext.class);
        if(context == null) {
            throw new RuntimeException("Could not find @PersistenceContext annotation on " + injectionPoint.getMember());
        }
        final String scopedPuName = getScopedPUName(deploymentUnit, context.unitName());
        final ServiceName persistenceUnitServiceName = PersistenceUnitService.getPUServiceName(scopedPuName);

        final ServiceController<?> serviceController = serviceRegistry.getRequiredService(persistenceUnitServiceName);
        //now we have the service controller, as this method is only called at runtime the service should
        //always be up
View Full Code Here

        //TODO: cache this stuff
        final PersistenceContext context = injectionPoint.getAnnotated().getAnnotation(PersistenceContext.class);
        if(context == null) {
            throw new RuntimeException("Could not find @PersistenceContext annotation on " + injectionPoint.getMember());
        }
        final String scopedPuName = getScopedPUName(deploymentUnit, context.unitName());
        final ServiceName persistenceUnitServiceName = PersistenceUnitService.getPUServiceName(scopedPuName);

        final ServiceController<?> serviceController = serviceRegistry.getRequiredService(persistenceUnitServiceName);
        //now we have the service controller, as this method is only called at runtime the service should
        //always be up
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.