code: public boolean evaluateCustomQuery(final String customQuery, final Map<String, Object> parameters) {
  
  		final SessionTransaction tx = db.getCurrentTransaction();
  		boolean result              = false;
  
  		try {
  			result = tx.getBoolean(customQuery, parameters);
  
  		} catch (Exception ignore) {}
  
  		return result;
  	}
docs: Evaluate a custom query and return result as a boolean value
  
  @param customQuery
  @param parameters
  @return