You can just compare resource.getVoId() and save DB queries.