@TransactionalWrite public Hub createHub(Hub hub, User currentUser) { authorize(currentUser, HUB_CREATE); validationService.validate(hub); return getHub(repository.insertHub(hub)); }
@TransactionalWrite public Hub updateHub(long hubId, Hub hub, User currentUser) { authorize(currentUser, HUB_UPDATE); validationService.validate(hub); repository.updateHub(hubId, hub); return getHub(hubId); }
@TransactionalRead public SearchResults<Hub> search(HubSearch search) { return repository.findHubs(search); }
@TransactionalRead public Hub getHub(long hubId) { return repository.getHub(hubId); }