protected Authorization getDbAuthorization() {
    Authorization dbAuthorization = authorizationService.createAuthorizationQuery()
      .authorizationId(resourceId)
      .singleResult();

    if (dbAuthorization == null) {
      throw new InvalidRequestException(Status.NOT_FOUND, "Authorization with id " + resourceId + " does not exist.");

    } else {
      return dbAuthorization;

    }
  }
protected Authorization getDbAuthorization ( ) { Authorization dbAuthorization = authorizationService . createAuthorizationQuery ( ) . authorizationId ( resourceId ) . singleResult ( ) ; if ( dbAuthorization == null ) { throw new InvalidRequestException ( Status . NOT_FOUND , "Authorization with id " + resourceId + " does not exist." ) ; } else { return dbAuthorization ; } }
utils //////////////////////////////////////////////////