code: public boolean exists() {
          Object val = executeScalar();
          if (null == val) {
              return false;
          }
  
          if (val instanceof Number) {
              return convertLong(val) > 0;
          }
  
          if (val instanceof Boolean) {
              return (Boolean) val;
          }
  
          if (val instanceof String) {
              return convertBoolean(val);
          }
  
          throw new ApplicationException(Code.BACKEND_ERROR,
                  "Expected a Numeric or Boolean scalar return value from the query, received " +
                          val.getClass().getName());
      }
docs: Utility method for evaluating the prepared statement as a query to check the existence of a record using a
  numeric count or boolean return value.
  <p>
  The {@link #rawQuery} provided must result in a {@link Number} or {@link Boolean} result.
  
  @return {@literal true} If a count query returned more than 0 or an exists query returns {@literal true}.
  
  @throws ApplicationException If an unexpected return type cannot be evaluated to a {@code Boolean} result.