}
public QueryResult execute() throws InvalidQueryException, RepositoryException {
QueryResult jcr_result = null;
Registry registry;
String sql1 = "";
registry = session.getUserRegistry();
if (statement.startsWith("org.wso2.registry.direct.query")) {
sql1 = statement.split(";;")[1];
} else {
sql1 = getConvertedRegQuery(statement);
}
Resource q1 = null;
Set nodes = new HashSet();
try {
//this modifications are done so that the queries are not stored in the registry.
// q1 = registry.newResource();
// q1.setContent(sql1);
// q1.setMediaType(RegistryConstants.SQL_QUERY_MEDIA_TYPE);
// q1.addProperty(RegistryConstants.RESULT_TYPE_PROPERTY_NAME,
// RegistryConstants.RESOURCES_RESULT_TYPE);
// registry.put(RegistryConstants.CONFIG_REGISTRY_BASE_PATH + RegistryConstants.QUERIES_COLLECTION_PATH + "/custom-queries", q1);
Map parameters = new HashMap();
parameters.put("query",sql1);
// Resource result = registry.executeQuery(RegistryConstants.CONFIG_REGISTRY_BASE_PATH + RegistryConstants.QUERIES_COLLECTION_PATH + "/custom-queries", parameters);
Resource result = registry.executeQuery(null, parameters);
String[] paths = (String[]) result.getContent();
for (String path : paths) {