private MISchema getMISchema(String catName, String dbName, String name) {
    try (QueryWrapper query = new QueryWrapper(pm.newQuery(MISchema.class,
        "name == schemaName && db.name == dbname && db.catalogName == cat"))) {
      name = normalizeIdentifier(name);
      dbName = normalizeIdentifier(dbName);
      catName = normalizeIdentifier(catName);
      query.declareParameters(
          "java.lang.String schemaName, java.lang.String dbname, java.lang.String cat");
      query.setUnique(true);
      MISchema mSchema = (MISchema)query.execute(name, dbName, catName);
      pm.retrieve(mSchema);
      return mSchema;
    }
  }
Api to fetch all constraints at once
@param request request object
@return all table constraints
@throws MetaException
@throws NoSuchObjectException
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java