Class QueryBuilder


  • public final class QueryBuilder
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Query createQuery​(java.lang.String query, Database database)
      Create Query from a N1QL string
      static Select select​(SelectResult... results)
      Create a SELECT statement instance that you can use further (e.g.
      static Select selectDistinct​(SelectResult... results)
      Create a SELECT DISTINCT statement instance that you can use further (e.g.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • select

        @NonNull
        public static Select select​(@NonNull
                                    SelectResult... results)
        Create a SELECT statement instance that you can use further (e.g. calling the from() function) to construct the complete query statement.
        Parameters:
        results - The array of the SelectResult object for specifying the returned values.
        Returns:
        A Select object.
      • selectDistinct

        @NonNull
        public static Select selectDistinct​(@NonNull
                                            SelectResult... results)
        Create a SELECT DISTINCT statement instance that you can use further (e.g. calling the from() function) to construct the complete query statement.
        Parameters:
        results - The array of the SelectResult object for specifying the returned values.
        Returns:
        A Select distinct object.
      • createQuery

        @NonNull
        public static Query createQuery​(@NonNull
                                        java.lang.String query,
                                        @NonNull
                                        Database database)
                                 throws CouchbaseLiteException
        Create Query from a N1QL string
        Parameters:
        query - A valid N1QL query.
        Returns:
        database The database against which the query will be run.
        Throws:
        CouchbaseLiteException