-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
302c8ac
commit 2b96da9
Showing
5 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
src/main/java/com/smunity/petition/domain/account/repository/DepartmentJpaRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.smunity.petition.domain.account.repository; | ||
|
||
import com.smunity.petition.domain.account.entity.Department; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import java.util.Optional; | ||
|
||
public interface DepartmentJpaRepository extends JpaRepository<Department, Long> { | ||
|
||
Optional<Department> findByName(String name); | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/com/smunity/petition/domain/account/repository/YearJpaRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.smunity.petition.domain.account.repository; | ||
|
||
|
||
import com.smunity.petition.domain.account.entity.Year; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import java.util.Optional; | ||
|
||
public interface YearJpaRepository extends JpaRepository<Year, Long> { | ||
|
||
Optional<Year> findByYear(String year); | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/com/smunity/petition/domain/account/repository/user/UserJpaRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.smunity.petition.domain.account.repository.user; | ||
|
||
import com.smunity.petition.domain.account.entity.User; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import java.util.Optional; | ||
|
||
public interface UserJpaRepository extends JpaRepository<User, Long> { | ||
|
||
Optional<User> findByUserName(String username); | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/com/smunity/petition/domain/account/repository/user/UserRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.smunity.petition.domain.account.repository.user; | ||
|
||
|
||
import com.smunity.petition.domain.account.entity.User; | ||
|
||
import java.util.Optional; | ||
|
||
public interface UserRepository { | ||
|
||
Optional<User> findByUserName(String username); | ||
|
||
User save(User user); | ||
} |
25 changes: 25 additions & 0 deletions
25
src/main/java/com/smunity/petition/domain/account/repository/user/UserRepositoryImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.smunity.petition.domain.account.repository.user; | ||
|
||
import com.smunity.petition.domain.account.entity.User; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import java.util.Optional; | ||
|
||
@RequiredArgsConstructor | ||
@Repository | ||
public class UserRepositoryImpl implements UserRepository { | ||
|
||
private final UserJpaRepository userJpaRepository; | ||
|
||
|
||
@Override | ||
public Optional<User> findByUserName(String username) { | ||
return userJpaRepository.findByUserName(username); | ||
} | ||
|
||
@Override | ||
public User save(User user) { | ||
return userJpaRepository.save(user); | ||
} | ||
} |