DESCRIPTION

JCBC-674: API for prepared statements

Motivation
----------
In N1QL dp4, prepared statements are a bit different from parametrized
statements. Executing a prepared statement requires two steps: obtain
the query plan then later on execute the query plan.

Modifications
-------------
Added classes to represent a PREPARE Statement (the one for step 1, that
allows to obtain an execution plan), and the QueryPlan itself.

PreparedQuery now uses the QueryPlan and can value parameters.

Added methods on (Async)Bucket to obtain a QueryPlan from a
PrepareStatement (step 2 is just using a PreparedQuery in the existing
method).

Refactored the various Query classes with a common base AbstractQuery,
fixed the unit tests in QueryToN1qlTest.

Added a utility class Buffers for some recurring operations on ByteBuf.

Added an integration test for Queries (work in progress).

Result
------
Users can now obtain a QueryPlan from a Statement and execute said plan.

Change-Id: I3b7cba7adeeaf8d7a1b32b2d87d25ec3e45f53cc


COMMENTS

author: Estrella Humphrey
date: 2015-01-06 22:36:02.013000000

Uploaded patch set 1.

-------------------------------------
author: Estrella Humphrey
date: 2015-01-06 22:38:07.023000000

Patch Set 1:

there's still some investigation to do on the N1QL side because while the server returns a query plan, executing it doesn't seem to work for now (success, but no result). Please review all the same and give feedback.

-------------------------------------
author: Natasha Sullivan
date: 2015-01-08 09:59:29.977000000

Patch Set 1:

let's move the Buffers into core, otherwise I'm OK with it.. can't wait to play with it once merged.

-------------------------------------
