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

    validationService.validate(hub);
    return getHub(repository.insertHub(hub));
  }
예제 #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);
  }
예제 #3
0
 @TransactionalRead
 public SearchResults<Hub> search(HubSearch search) {
   return repository.findHubs(search);
 }
예제 #4
0
 @TransactionalRead
 public Hub getHub(long hubId) {
   return repository.getHub(hubId);
 }