/** Remove some column pairs from the holder. * @param pairs the column pairs to remove * @throws ModelException if impossible */ public void removeColumnPairs (ColumnPairElement[] pairs) throws ModelException { ArrayList pairNames = new ArrayList(); int i, count = ((pairs != null) ? pairs.length : 0); for (i = 0; i < count ; i++) { ColumnPairElement pair = (ColumnPairElement)pairs[i]; pairNames.add(NameUtil.getRelativeMemberName( pair.getName().getFullName())); } removeColumnPairs(pairNames); }
/** Remove some column pairs from the holder. * @param pairs the column pairs to remove * @throws ModelException if impossible */ public void removeColumnPairs (ColumnPairElement[] pairs) throws ModelException { ArrayList pairNames = new ArrayList(); int i, count = ((pairs != null) ? pairs.length : 0); for (i = 0; i < count ; i++) { ColumnPairElement pair = (ColumnPairElement)pairs[i]; pairNames.add(NameUtil.getRelativeMemberName( pair.getName().getFullName())); } removeColumnPairs(pairNames); }
/** Returns <code>true</code> if the specified list of column * pair names matches exactly the specified FK. */ private boolean matchesFK (List pairNames, ForeignKeyElement foreignKey) { ColumnPairElement[] fkPairs = foreignKey.getColumnPairs(); int fkCount = ((fkPairs != null) ? fkPairs.length : 0); int count = ((pairNames != null) ? pairNames.size() : 0); // First check whether the list of fk column pairs has the // same size than the specified list of columns. if (fkCount == count) { // Now check whether each fk column is included in the // specified list of columns. for (int i = 0; i < fkCount; i++) { String fkPairName = NameUtil.getRelativeMemberName( fkPairs[i].getName().getFullName()); if (!pairNames.contains(fkPairName)) return false; } return true; } return false; } };
/** Returns <code>true</code> if the specified list of column * pair names matches exactly the specified FK. */ private boolean matchesFK (List pairNames, ForeignKeyElement foreignKey) { ColumnPairElement[] fkPairs = foreignKey.getColumnPairs(); int fkCount = ((fkPairs != null) ? fkPairs.length : 0); int count = ((pairNames != null) ? pairNames.size() : 0); // First check whether the list of fk column pairs has the // same size than the specified list of columns. if (fkCount == count) { // Now check whether each fk column is included in the // specified list of columns. for (int i = 0; i < fkCount; i++) { String fkPairName = NameUtil.getRelativeMemberName( fkPairs[i].getName().getFullName()); if (!pairNames.contains(fkPairName)) return false; } return true; } return false; } };
column.getName().getFullName());
column.getName().getFullName());
pair.getName().getFullName())) == -1)
pair.getName().getFullName())) == -1)