/** @see org.eclipse.gef.commands.Command#canExecute() */
  @Override
  public boolean canExecute() {

    boolean returnValue = true;
    if (foreignEntity.equals(primaryEntity)) {
      returnValue = false;
    } else {

      if (primaryEntity == null) {
        return false;
      } else {
        // Check for existence of relationship already
        List<ERDAssociation> relationships = primaryEntity.getPrimaryKeyRelationships();
        for (int i = 0; i < relationships.size(); i++) {
          ERDAssociation currentRelationship = relationships.get(i);
          if (currentRelationship.getForeignKeyEntity().equals(foreignEntity)) {
            returnValue = false;
            break;
          }
        }
      }
    }
    return returnValue;
  }