java.lang.Object
org.springframework.data.couchbase.repository.query.CountFragment

public class CountFragment extends Object
An utility entity that allows to extract total row count out of a COUNT(*) N1QL query.

The query should use the COUNT_ALIAS, eg.: SELECT COUNT(*) AS count FROM default;

This ensures that the framework will be able to map the JSON result to this CountFragment class so that it can be used.

  • Field Details

    • COUNT_ALIAS

      public static final String COUNT_ALIAS
      Use this alias for the COUNT part of a N1QL query so that the framework can extract the count result. Eg.: "SELECT A.COUNT(*) AS " + COUNT_ALIAS + " FROM A";
      See Also:
    • count

      public long count
      The value for a COUNT that used COUNT_ALIAS as an alias.
  • Constructor Details

    • CountFragment

      public CountFragment()