From 85ed0c38d18911502b2b6ffcff76bb33733a51aa Mon Sep 17 00:00:00 2001 From: Ludy Date: Sat, 20 Jul 2024 11:13:49 +0200 Subject: [PATCH] Adding declaration as repository component & changing primary key type (#1559) * Adding declaration as repository component & changing primary key type * Update AuthorityRepository.java * Update PersistentLoginRepository.java --------- Co-authored-by: Anthony Stirling <77850077+Frooodle@users.noreply.github.com> --- .../software/SPDF/repository/AuthorityRepository.java | 2 ++ .../software/SPDF/repository/PersistentLoginRepository.java | 2 ++ .../stirling/software/SPDF/repository/UserRepository.java | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/stirling/software/SPDF/repository/AuthorityRepository.java b/src/main/java/stirling/software/SPDF/repository/AuthorityRepository.java index 41c251e1..01f23dd9 100644 --- a/src/main/java/stirling/software/SPDF/repository/AuthorityRepository.java +++ b/src/main/java/stirling/software/SPDF/repository/AuthorityRepository.java @@ -3,9 +3,11 @@ package stirling.software.SPDF.repository; import java.util.Set; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; import stirling.software.SPDF.model.Authority; +@Repository public interface AuthorityRepository extends JpaRepository { // Set findByUsername(String username); Set findByUser_Username(String username); diff --git a/src/main/java/stirling/software/SPDF/repository/PersistentLoginRepository.java b/src/main/java/stirling/software/SPDF/repository/PersistentLoginRepository.java index 31841a57..92d7bb81 100644 --- a/src/main/java/stirling/software/SPDF/repository/PersistentLoginRepository.java +++ b/src/main/java/stirling/software/SPDF/repository/PersistentLoginRepository.java @@ -1,7 +1,9 @@ package stirling.software.SPDF.repository; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; import stirling.software.SPDF.model.PersistentLogin; +@Repository public interface PersistentLoginRepository extends JpaRepository {} diff --git a/src/main/java/stirling/software/SPDF/repository/UserRepository.java b/src/main/java/stirling/software/SPDF/repository/UserRepository.java index ad65f27d..cf0c80d1 100644 --- a/src/main/java/stirling/software/SPDF/repository/UserRepository.java +++ b/src/main/java/stirling/software/SPDF/repository/UserRepository.java @@ -3,10 +3,12 @@ package stirling.software.SPDF.repository; import java.util.Optional; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.stereotype.Repository; import stirling.software.SPDF.model.User; -public interface UserRepository extends JpaRepository { +@Repository +public interface UserRepository extends JpaRepository { Optional findByUsernameIgnoreCase(String username); Optional findByUsername(String username);