Package javax.persistence

Examples of javax.persistence.PersistenceContextType


                    if(properties != null) {
                        for(PropertyMetaData prop : properties) {
                            map.put(prop.getKey(),prop.getValue());
                        }
                    }
                    PersistenceContextType type = puRef.getPersistenceContextType() == null ? PersistenceContextType.TRANSACTION : puRef.getPersistenceContextType();
                    bindingDescription.setReferenceSourceDescription(getPersistenceContextBindingSource(deploymentUnit, persistenceUnitName, type, map));
                } else {
                    bindingDescription.setReferenceSourceDescription(new LazyBindingSourceDescription());
                }
            }
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

     */   
    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

            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 (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("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

/*  66 */       if (container.getEncInjectors().containsKey(encName)) {
/*     */         continue;
/*     */       }
/*  69 */       String error = "unable to load <persistence-context-ref> for unitName: " + ref.getPersistenceUnitName() + " <ref-name>: " + ref.getPersistenceContextRefName();
/*     */
/*  71 */       PersistenceContextType type = ref.getPersistenceContextType();
/*  72 */       String unitName = ref.getPersistenceUnitName();
/*  73 */       container.getEncInjectors().put(encName, new PcEncInjector(encName, unitName, type, injectionType, error));
/*     */       try
/*     */       {
/*  76 */         PersistenceUnitHandler.addPUDependency(ref.getPersistenceUnitName(), container);
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.