1 21 package oracle.toplink.essentials.internal.ejb.cmp3.xml.accessors; 23 24 import org.w3c.dom.Node ; 25 import org.w3c.dom.NodeList ; 26 27 import oracle.toplink.essentials.internal.ejb.cmp3.xml.XMLHelper; 28 import oracle.toplink.essentials.internal.ejb.cmp3.xml.XMLConstants; 29 30 import oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.RelationshipAccessor; 31 32 36 public class XMLAccessorHelper { 37 40 public static void setRelationshipAccessorData(RelationshipAccessor accessor, Node node, XMLHelper helper) { 41 accessor.setFetchType(helper.getNodeValue(node, XMLConstants.ATT_FETCH, accessor.getFetchType())); 42 accessor.setMappedBy(helper.getNodeValue(node, XMLConstants.ATT_MAPPED_BY, accessor.getMappedBy())); 43 accessor.setIsOptional(helper.getNodeValue(node, XMLConstants.ATT_OPTIONAL, accessor.isOptional())); 44 accessor.setTargetEntity(helper.getNodeValue(node, XMLConstants.ATT_TARGET_ENTITY, accessor.getTargetEntity())); 45 46 NodeList cascadeTypes = helper.getNodes(node, XMLConstants.CASCADE, XMLConstants.ALL_CHILDREN); 47 for (int i = 0; i < cascadeTypes.getLength(); i++) { 48 accessor.addCascadeType(cascadeTypes.item(i).getLocalName()); 49 } 50 } 51 } 52 | Popular Tags |