public Collection<ObjRelationship> allRelationships() {
    if (subentities == null) {
      return entity.getRelationships();
    }

    Collection<ObjRelationship> c = new ArrayList<ObjRelationship>();
    appendDeclaredRelationships(c);

    // add base relationships if any
    ObjEntity superEntity = entity.getSuperEntity();
    if (superEntity != null) {
      c.addAll(superEntity.getRelationships());
    }

    return c;
  }
  public Collection<ObjAttribute> allAttributes() {
    if (subentities == null) {
      return entity.getAttributes();
    }

    Collection<ObjAttribute> c = new ArrayList<ObjAttribute>();
    appendDeclaredAttributes(c);

    // add base attributes if any
    ObjEntity superEntity = entity.getSuperEntity();
    if (superEntity != null) {
      c.addAll(superEntity.getAttributes());
    }

    return c;
  }