junction: fix bug when computing blocking durations

This patch removes

  getBlockingAll(UUID blockableId, BlockingStateType blockingStateType, InternalTenantContext context);

from BlockingInternalApi: junction was calling it multiple times for different blockingStateType, which
was breaking the natural ordering of events and hence introducing bugs when computing blocking durations.

Instead, we introduce

  getBlockingAllForAccount(InternalTenantContext context);

Events are ordered correctly by junction and will return bundle, subscription and account level blocking
events (we were ignoring the subscription level ones before for some reason).

This also:

* fixes the ordering returned by the SQL statements (only really needed for getBlockingStateForService
as we re-order the other calls in ProxyBlockingStateDao).
* removes BillingEventSet#isLast which wasn't used.

This closes #123.

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Merge remote-tracking branch 'origin/master' into junction-bug-fixes

Conflicts:
	entitlement/src/main/java/com/ning/billing/entitlement/dao/ProxyBlockingStateDao.java

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Fixes #132

(Also fixes the bug introduced during the perf optimization in subscription base where events are retrieved by account_record_id and where
ordering by effective_date, record_id must be enforced)
Code review integration for default sql ordering
beatrix: fix ClassCastException

Reported-by: Nitin Singh <nsiitk@gmail.com>
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Merge branch 'junction-bug-fixes' of github.com:killbill/killbill into junction-bug-fixes
Merge remote-tracking branch 'origin/master' into junction-bug-fixes