/** * write the descriptor class to a DOM tree and return it * * @param parent node in the DOM tree * @param node name for the root element of this xml fragment * @param the descriptor to write * @return the DOM tree top node */ public Node writeDescriptor(Node parent, String nodeName, EntityManagerFactoryReferenceDescriptor descriptor) { Node entityMgrFactoryRefNode = appendChild(parent, nodeName); writeLocalizedDescriptions(entityMgrFactoryRefNode, descriptor); appendTextChild(entityMgrFactoryRefNode, TagNames.PERSISTENCE_UNIT_REF_NAME, descriptor.getName()); appendTextChild(entityMgrFactoryRefNode, TagNames.PERSISTENCE_UNIT_NAME, descriptor.getUnitName()); if( descriptor.isInjectable() ) { InjectionTargetNode ijNode = new InjectionTargetNode(); for (InjectionTarget target : descriptor.getInjectionTargets()) { ijNode.writeDescriptor(entityMgrFactoryRefNode, TagNames.INJECTION_TARGET, target); } } return entityMgrFactoryRefNode; } }
/** * write the descriptor class to a DOM tree and return it * * @param parent node in the DOM tree * @param node name for the root element of this xml fragment * @param the descriptor to write * @return the DOM tree top node */ public Node writeDescriptor(Node parent, String nodeName, EntityManagerFactoryReferenceDescriptor descriptor) { Node entityMgrFactoryRefNode = appendChild(parent, nodeName); writeLocalizedDescriptions(entityMgrFactoryRefNode, descriptor); appendTextChild(entityMgrFactoryRefNode, TagNames.PERSISTENCE_UNIT_REF_NAME, descriptor.getName()); appendTextChild(entityMgrFactoryRefNode, TagNames.PERSISTENCE_UNIT_NAME, descriptor.getUnitName()); if( descriptor.isInjectable() ) { InjectionTargetNode ijNode = new InjectionTargetNode(); for (InjectionTarget target : descriptor.getInjectionTargets()) { ijNode.writeDescriptor(entityMgrFactoryRefNode, TagNames.INJECTION_TARGET, target); } } return entityMgrFactoryRefNode; } }