/** * write a list of entity manager reference descriptors to a DOM Tree * * @param parentNode parent node for the DOM tree * @param entityMgrRefs the iterator over the descriptors to write */ protected void writeEntityManagerReferenceDescriptors(Node parentNode, Iterator entityMgrRefs) { if (entityMgrRefs==null || !entityMgrRefs.hasNext()) return; EntityManagerReferenceNode subNode = new EntityManagerReferenceNode(); for (;entityMgrRefs.hasNext();) { EntityManagerReferenceDescriptor aEntityMgrRef = (EntityManagerReferenceDescriptor)entityMgrRefs.next(); subNode.writeDescriptor(parentNode, TagNames.PERSISTENCE_CONTEXT_REF, aEntityMgrRef); } }
public EntityManagerReferenceNode() { super(); registerElementHandler(new XMLElement(TagNames.INJECTION_TARGET), InjectionTargetNode.class, "addInjectionTarget"); }
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); Node propertyNode = appendChild(entityMgrRefNode, TagNames.PERSISTENCE_PROPERTY); appendTextChild(propertyNode, TagNames.NAME_VALUE_PAIR_NAME, property.getKey()); appendTextChild(propertyNode, TagNames.NAME_VALUE_PAIR_VALUE, property.getValue());
if (TagNames.PERSISTENCE_CONTEXT_TYPE.equals(element.getQName())) { EntityManagerReferenceDescriptor entityMgrReferenceDescriptor = (EntityManagerReferenceDescriptor)getDescriptor(); PersistenceContextType contextType = null; if (EXTENDED.equals(value)) { } else if (TagNames.NAME_VALUE_PAIR_VALUE.equals(element.getQName())) { EntityManagerReferenceDescriptor entityMgrReferenceDescriptor = (EntityManagerReferenceDescriptor)getDescriptor(); entityMgrReferenceDescriptor.addProperty(propertyName, value); propertyName = null;
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); Node propertyNode = appendChild(entityMgrRefNode, TagNames.PERSISTENCE_PROPERTY); appendTextChild(propertyNode, TagNames.NAME_VALUE_PAIR_NAME, property.getKey()); appendTextChild(propertyNode, TagNames.NAME_VALUE_PAIR_VALUE, property.getValue());
if (TagNames.PERSISTENCE_CONTEXT_TYPE.equals(element.getQName())) { EntityManagerReferenceDescriptor entityMgrReferenceDescriptor = (EntityManagerReferenceDescriptor)getDescriptor(); PersistenceContextType contextType = null; if (EXTENDED.equals(value)) { (EntityManagerReferenceDescriptor)getDescriptor(); SynchronizationType synchronizationType; if (SYNCHRONIZED.equals(value)) { } else if (TagNames.NAME_VALUE_PAIR_VALUE.equals(element.getQName())) { EntityManagerReferenceDescriptor entityMgrReferenceDescriptor = (EntityManagerReferenceDescriptor)getDescriptor(); entityMgrReferenceDescriptor.addProperty(propertyName, value); propertyName = null;
/** * write a list of entity manager reference descriptors to a DOM Tree * * @param parentNode parent node for the DOM tree * @param entityMgrRefs the iterator over the descriptors to write */ protected void writeEntityManagerReferenceDescriptors(Node parentNode, Iterator entityMgrRefs) { if (entityMgrRefs==null || !entityMgrRefs.hasNext()) return; EntityManagerReferenceNode subNode = new EntityManagerReferenceNode(); for (;entityMgrRefs.hasNext();) { EntityManagerReferenceDescriptor aEntityMgrRef = (EntityManagerReferenceDescriptor)entityMgrRefs.next(); subNode.writeDescriptor(parentNode, TagNames.PERSISTENCE_CONTEXT_REF, aEntityMgrRef); } }
public EntityManagerReferenceNode() { super(); registerElementHandler(new XMLElement(TagNames.INJECTION_TARGET), InjectionTargetNode.class, "addInjectionTarget"); }