protected void fromJSONObject(JSONObject object, Procedure catalog_proc) throws JSONException {
super.fromJSONObject(object, CatalogUtil.getDatabase(catalog_proc));
this.batch_id = object.getInt(Members.BATCH_ID.name());
Statement catalog_stmt = null;
if (this.catalog_item_name.contains(":") == false) {
catalog_stmt = catalog_proc.getStatements().getIgnoreCase(this.catalog_item_name);
} else {
catalog_stmt = CatalogKey.getFromKey(CatalogUtil.getDatabase(catalog_proc),
this.catalog_item_name, Statement.class);
}
if (catalog_stmt == null) {
catalog_stmt = catalog_proc.getStatements().getIgnoreCase(CatalogKey.getNameFromKey(this.catalog_item_name));
if (catalog_stmt == null) {
String msg = "Procedure '" + catalog_proc.getName() + "' does not have a Statement '" + this.catalog_item_name + "'";
msg += "\nValid Statements: " + CatalogUtil.debug(catalog_proc.getStatements());
throw new JSONException(msg);
}
}
// HACK
this.catalog_item_name = CatalogKey.createKey(catalog_stmt);
try {
super.paramsFromJSONObject(object, catalog_stmt.getParameters(), "javatype");
} catch (Exception ex) {
LOG.fatal("Failed to load query trace for " + this.catalog_item_name);
throw new JSONException(ex);
}
}