View Javadoc
1   /*
2    * Copyright (C) 2021 B3Partners B.V.
3    *
4    * SPDX-License-Identifier: MIT
5    */
6   package org.tailormap.api.repository;
7   
8   import java.util.Optional;
9   import org.springframework.data.jpa.repository.JpaRepository;
10  import org.springframework.lang.NonNull;
11  import org.springframework.security.access.prepost.PreAuthorize;
12  import org.tailormap.api.persistence.Application;
13  import org.tailormap.api.security.annotation.PreAuthorizeAdmin;
14  
15  @PreAuthorizeAdmin
16  public interface ApplicationRepository extends JpaRepository<Application, Long> {
17    @PreAuthorize("permitAll()")
18    Application findByName(String name);
19  
20    @PreAuthorize("permitAll()")
21    @Override
22    @NonNull
23    Optional<Application> findById(@NonNull Long aLong);
24  }