Example #1
0
 /**
  * Method "getPrimaryKeys".
  *
  * @param table a table
  * @return a list of all primary keys of the given table
  * @deprecated use getPrimaryKey() instead
  */
 @Deprecated
 public static List<PrimaryKey> getPrimaryKeys(Table table) {
   List<PrimaryKey> primarykeys = new ArrayList<PrimaryKey>();
   EList<ModelElement> ownedElements = table.getOwnedElement();
   for (ModelElement modelElement : ownedElements) {
     PrimaryKey pk = SwitchHelpers.PRIMARY_KEY_SWITCH.doSwitch(modelElement);
     if (pk != null) {
       primarykeys.add(pk);
     }
   }
   return primarykeys;
 }
Example #2
0
 /**
  * Method "removeForeignKey".
  *
  * @param table
  * @param foreignKey
  * @return true if the FK existed in the table
  */
 public static boolean removeForeignKey(Table table, ForeignKey foreignKey) {
   assert table != null;
   assert foreignKey != null;
   return table.getOwnedElement().remove(foreignKey);
 }