View Javadoc
1   /*
2    * Copyright (C) 2024 B3Partners B.V.
3    *
4    * SPDX-License-Identifier: MIT
5    */
6   
7   package org.tailormap.api.repository;
8   
9   import java.util.Optional;
10  import org.springframework.data.jpa.repository.JpaRepository;
11  import org.springframework.data.rest.core.annotation.RepositoryRestResource;
12  import org.springframework.security.access.prepost.PreAuthorize;
13  import org.tailormap.api.persistence.Page;
14  
15  @RepositoryRestResource(path = "pages", collectionResourceRel = "pages", itemResourceRel = "page")
16  public interface PageRepository extends JpaRepository<Page, Long> {
17    @PreAuthorize("permitAll()")
18    Optional<Page> findByName(String name);
19  }