Set<EntityId> assetIds = Sets.newHashSet();
final String query = String.format("SELECT FROM %s WHERE %s = ?", AssetAdapter.BASE_CLASS_NAME, P_COMPONENT);
ORID componentRid = componentDocument.getIdentity();
List<ODocument> results = db.command(new OSQLSynchQuery<>(query)).execute(componentRid);
for (ODocument assetDocument: results) {
assetIds.add(new EntityId((String) assetDocument.field(EntityAdapter.P_ID)));
}
return componentFrom(componentAdapter, componentDocument, assetIds);
}