Package javax.persistence

Examples of javax.persistence.PersistenceContextType


            // Persistence context
            EZBPersistenceUnitManager persistenceUnitManager = this.injectionHolder.getPersistenceUnitManager();
            for (IENCBinding<IJavaxPersistenceContext> binding : this.encBindingHolder.getPersistenceContextBindings()) {
                String encName = binding.getName();
                String unitName = binding.getValue().getUnitName();
                PersistenceContextType type = binding.getValue().getType();
                EntityManager em = persistenceUnitManager.getEntityManager(unitName, type);

                try {
                    createSubcontexts(envCtx, encName);
                    envCtx.rebind(encName, em);
View Full Code Here


      if(name.length() == 0)
         name = ProcessorUtils.getName(element);
      ref.setPersistenceContextRefName(name);
      if(annotation.unitName().length() > 0)
         ref.setPersistenceUnitName(annotation.unitName());
      PersistenceContextType type = annotation.type();
      ref.setPersistenceContextType(type);

      PersistenceProperty[] properties = annotation.properties();
      if(properties.length > 0 )
      {
View Full Code Here

                        if (properties != null) {
                            for (PropertyMetaData prop : properties) {
                                map.put(prop.getKey(), prop.getValue());
                            }
                        }
                        PersistenceContextType type = puRef.getPersistenceContextType() == null ? PersistenceContextType.TRANSACTION : puRef.getPersistenceContextType();
                        InjectionSource pcBindingSource = this.getPersistenceContextBindingSource(deploymentUnit, persistenceUnitName, type, map);
                        bindingConfiguration = new BindingConfiguration(name, pcBindingSource);
                    }
                    bindingConfigurations.add(bindingConfiguration);
                }
View Full Code Here

            if (pu.getTransactionType() == PersistenceUnitTransactionType.RESOURCE_LOCAL) {
                classDescription.setInvalid(MESSAGES.cannotInjectResourceLocalEntityManager());
                return null;
            }
            AnnotationValue pcType = annotation.value("type");
            PersistenceContextType type = (pcType == null || PersistenceContextType.TRANSACTION.name().equals(pcType.asString()))
                ? PersistenceContextType.TRANSACTION : PersistenceContextType.EXTENDED;

            Map properties;
            AnnotationValue value = annotation.value("properties");
            AnnotationInstance[] props = value != null ? value.asNestedArray() : null;
View Full Code Here

            if(pu.getTransactionType() == PersistenceUnitTransactionType.RESOURCE_LOCAL) {
                classDescription.setInvalid("Cannot inject RESOURCE_LOCAL container manged EntityManager's using @PersistenceContext");
                return null;
            }
            AnnotationValue pcType = annotation.value("type");
            PersistenceContextType type = (pcType == null || PersistenceContextType.TRANSACTION.name().equals(pcType.asString()))
                    ? PersistenceContextType.TRANSACTION : PersistenceContextType.EXTENDED;

            Map properties;
            AnnotationValue value = annotation.value("properties");
            AnnotationInstance[] props = value != null ? value.asNestedArray() : null;
View Full Code Here

                    if (properties != null) {
                        for (PropertyMetaData prop : properties) {
                            map.put(prop.getKey(), prop.getValue());
                        }
                    }
                    PersistenceContextType type = puRef.getPersistenceContextType() == null ? PersistenceContextType.TRANSACTION : puRef.getPersistenceContextType();
                    InjectionSource pcBindingSource = this.getPersistenceContextBindingSource(deploymentUnit, persistenceUnitName, type, map);
                    bindingConfiguration = new BindingConfiguration(name, pcBindingSource);
                } else {
                    throw new RuntimeException("Support for persistence-context-ref without a lookup or persistence-unit-name, isn't yet implemented");
                }
View Full Code Here

      if(name.length() == 0)
         name = ProcessorUtils.getName(element);
      ref.setPersistenceContextRefName(name);
      if(annotation.unitName().length() > 0)
         ref.setPersistenceUnitName(annotation.unitName());
      PersistenceContextType type = annotation.type();
      ref.setPersistenceContextType(type);

      PersistenceProperty[] properties = annotation.properties();
      if(properties.length > 0 )
      {
View Full Code Here

        assertIsClosed();

        // Create a NucleusContext to do the actual persistence, using the original persistence-unit, plus these properties
        NucleusContext nucleusCtx = initialiseNucleusContext(unitMetaData, overridingProps);

        PersistenceContextType persistenceContext = PersistenceContextType.EXTENDED;
        if (containerManaged)
        {
            persistenceContext = PersistenceContextType.TRANSACTION;
        }
View Full Code Here

     */   
    public void setElementValue(XMLElement element, String value) {
        if (TagNames.PERSISTENCE_CONTEXT_TYPE.equals(element.getQName())) {
            EntityManagerReferenceDescriptor entityMgrReferenceDescriptor =
                (EntityManagerReferenceDescriptor)getDescriptor();
            PersistenceContextType contextType = null;
            if (EXTENDED.equals(value)) {
                contextType = PersistenceContextType.EXTENDED;
            } else if (TRANSACTION.equals(value)) {
                contextType = PersistenceContextType.TRANSACTION;
            } else {
View Full Code Here

        Node entityMgrRefNode = appendChild(parent, nodeName);
        writeLocalizedDescriptions(entityMgrRefNode, descriptor);
       
        appendTextChild(entityMgrRefNode, TagNames.PERSISTENCE_CONTEXT_REF_NAME, descriptor.getName());     
        appendTextChild(entityMgrRefNode, TagNames.PERSISTENCE_UNIT_NAME, descriptor.getUnitName());     
        PersistenceContextType contextType = descriptor.getPersistenceContextType();
        String contextTypeString = (contextType != null &&
            PersistenceContextType.EXTENDED.equals(contextType)) ?
            EXTENDED : TRANSACTION;
        appendTextChild(entityMgrRefNode, TagNames.PERSISTENCE_CONTEXT_TYPE,
            contextTypeString);
View Full Code Here

TOP

Related Classes of javax.persistence.PersistenceContextType

Copyright © 2018 www.massapicom. 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.