class MetadataNodeEntityAdapter extends IterableEntityAdapter<T> {

  protected void addBucketConstraints(@Nullable final String whereClause,
                                      @Nullable final Iterable<Bucket> buckets,
                                      final StringBuilder query)
  {
    if (buckets != null && !isEmpty(buckets)) {
      if (whereClause == null) {
        query.append(" where ");
      }
      else {
        query.append(" and ");
      }

      query.append('(');
      Joiner.on(" or ").appendTo(query,
          Iterables.transform(buckets, bucket ->
              String.format("%s=%s", P_BUCKET, bucketEntityAdapter.recordIdentity(bucket).toString())
          ));
      query.append(')');
    }
  }

  public  MetadataNodeEntityAdapter(final String typeName, final BucketEntityAdapter bucketEntityAdapter);

}