Ejemplo n.º 1
0
 private String getOneFKasString(KForeignKey fk) {
   String quote = QUOTE();
   return dbSpec.getCommand(
       "FOREIGN KEY ({fkField}) REFERENCES {referencesTable}({referencesField})",
       quote + fk.getFkField() + quote,
       quote + fk.getReferencesTable() + quote,
       quote + fk.getReferencesField() + quote);
 }
Ejemplo n.º 2
0
 private List<KForeignKey> getForeignKeys(KObject instance, String tableName) {
   List<KForeignKey> foreignKeys = new ArrayList<>();
   for (KConstraint constraint : instance.getConstraints()) {
     if (constraint.getForeignKey() != null) {
       KForeignKey fk = constraint.getForeignKey();
       fk.setTableName(tableName);
       foreignKeys.add(fk);
     }
   }
   return foreignKeys;
 }