Beispiel #1
0
  @TransactionalWrite
  public Hub createHub(Hub hub, User currentUser) {
    authorize(currentUser, HUB_CREATE);

    validationService.validate(hub);
    return getHub(repository.insertHub(hub));
  }
Beispiel #2
0
  @TransactionalWrite
  public Hub updateHub(long hubId, Hub hub, User currentUser) {
    authorize(currentUser, HUB_UPDATE);

    validationService.validate(hub);
    repository.updateHub(hubId, hub);
    return getHub(hubId);
  }
Beispiel #3
0
 @TransactionalRead
 public SearchResults<Hub> search(HubSearch search) {
   return repository.findHubs(search);
 }
Beispiel #4
0
 @TransactionalRead
 public Hub getHub(long hubId) {
   return repository.getHub(hubId);
 }