1 21 package oracle.toplink.essentials.internal.ejb.cmp3.xml.tables; 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.helper.DatabaseTable; 31 32 38 public class XMLTableHelper { 39 43 public static void processUniqueConstraints(Node node, XMLHelper helper, DatabaseTable table) { 44 NodeList uniqueConstraintNodes = helper.getNodes(node, XMLConstants.UNIQUE_CONSTRAINTS); 45 46 if (uniqueConstraintNodes != null) { 47 for (int i = 0; i < uniqueConstraintNodes.getLength(); i++) { 48 NodeList columnNameNodes = helper.getTextColumnNodes(uniqueConstraintNodes.item(i)); 49 50 if (columnNameNodes != null) { 51 for (int k = 0; k < columnNameNodes.getLength(); k++) { 52 String columnName = columnNameNodes.item(k).getNodeValue(); 53 54 if (columnName != null && !columnName.equals("")) { 55 table.addUniqueConstraint(columnName); 56 } 57 } 58 } 59 } 60 } 61 } 62 } 63 | Popular Tags |