class AssetEntityAdapter extends MetadataNodeEntityAdapter<Asset> {

  Iterable<Asset> browseByComponent(final ODatabaseDocumentTx db, final Component component) {
    checkNotNull(component);
    checkState(EntityHelper.hasMetadata(component));

    Map<String, Object> parameters = ImmutableMap.of(
        "bucket", bucketEntityAdapter.recordIdentity(component.bucketId()),
        "component", componentEntityAdapter.recordIdentity(component)
    );
    String query = String.format(
        "select from %s where %s = :bucket and %s = :component",
        DB_CLASS, P_BUCKET, P_COMPONENT
    );
    Iterable<ODocument> docs = db.command(new OCommandSQL(query)).execute(parameters);
    return transform(docs);
  }

  @Inject public  AssetEntityAdapter(final BucketEntityAdapter bucketEntityAdapter,
                            final ComponentEntityAdapter componentEntityAdapter);

}