1 21 package oracle.toplink.essentials.internal.ejb.cmp3.xml.queries; 23 24 import java.util.List ; 25 import java.util.ArrayList ; 26 27 import org.w3c.dom.Node ; 28 import org.w3c.dom.NodeList ; 29 30 import oracle.toplink.essentials.internal.ejb.cmp3.xml.XMLHelper; 31 import oracle.toplink.essentials.internal.ejb.cmp3.xml.XMLConstants; 32 33 import oracle.toplink.essentials.internal.ejb.cmp3.metadata.queries.MetadataFieldResult; 34 import oracle.toplink.essentials.internal.ejb.cmp3.metadata.queries.MetadataEntityResult; 35 36 42 public class XMLEntityResult extends MetadataEntityResult { 43 protected Node m_node; 44 protected XMLHelper m_helper; 45 46 49 public XMLEntityResult(Node node, XMLHelper helper) { 50 m_node = node; 51 m_helper = helper; 52 } 53 54 57 public String getDiscriminatorColumn() { 58 return m_helper.getNodeValue(m_node, XMLConstants.ATT_DISCRIMINATOR_COLUMN, ""); 59 } 60 61 66 public Class getEntityClass() { 67 return m_helper.getNodeValue(m_node, XMLConstants.ATT_ENTITY_CLASS, void.class); 68 } 69 70 73 public List <MetadataFieldResult> getFieldResults() { 74 if (m_fieldResults == null) { 75 m_fieldResults = new ArrayList <MetadataFieldResult>(); 76 NodeList fieldResultNodes = m_helper.getNodes(m_node, XMLConstants.FIELD_RESULT); 77 78 if (fieldResultNodes != null) { 79 for (int i = 0; i < fieldResultNodes.getLength(); i++) { 80 m_fieldResults.add(new XMLFieldResult(fieldResultNodes.item(i), m_helper)); 81 } 82 } 83 } 84 85 return m_fieldResults; 86 } 87 } 88 | Popular Tags |