Skip to content

Commit

Permalink
Merge pull request #52 from FlouD-2024/mypage
Browse files Browse the repository at this point in the history
fix: change all entity name to lowercase
  • Loading branch information
Kang1221 authored Mar 14, 2024
2 parents 0f7b29e + 26cbca0 commit def2ad8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/main/java/floud/demo/repository/AlarmRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

public interface AlarmRepository extends JpaRepository<Alarm, Long> {

@Query(value = "SELECT * FROM Alarm a WHERE a.users_id = :users_id " +
@Query(value = "SELECT * FROM alarm a WHERE a.users_id = :users_id " +
"ORDER BY a.created_at DESC limit 2", nativeQuery = true)
List<Alarm> find2ByUser(Long users_id);

@Query(value = "SELECT * FROM Alarm a WHERE a.users_id = :users_id " +
@Query(value = "SELECT * FROM alarm a WHERE a.users_id = :users_id " +
"ORDER BY a.created_at DESC limit 30", nativeQuery = true)
List<Alarm> find30ByUser(Long users_id);
}
4 changes: 2 additions & 2 deletions src/main/java/floud/demo/repository/CommunityRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

public interface CommunityRepository extends JpaRepository<Community, Long> {

@Query(value = "SELECT * FROM Community c WHERE c.post_type = :postType ORDER BY c.created_at DESC", nativeQuery = true)
@Query(value = "SELECT * FROM community c WHERE c.post_type = :postType ORDER BY c.created_at DESC", nativeQuery = true)
Page<Community> findAllByPostType(Pageable pageable, String postType);

@Query(value = "SELECT * FROM Community c WHERE c.users_id = :users_id ORDER BY c.created_at DESC", nativeQuery = true)
@Query(value = "SELECT * FROM community c WHERE c.users_id = :users_id ORDER BY c.created_at DESC", nativeQuery = true)
Page<Community> findAllByUser(Pageable pageable, Long users_id);
}
4 changes: 2 additions & 2 deletions src/main/java/floud/demo/repository/MemoirRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ public interface MemoirRepository extends JpaRepository<Memoir, Long> {
List<Memoir> findAllByDate(Long users_id, LocalDate startDate, LocalDate endDate);

@Query(value = "SELECT CASE WHEN COUNT(*) > 0 THEN 'TRUE' ELSE 'FALSE' " +
"END FROM Memoir m WHERE m.users_id = :users_id " +
"END FROM memoir m WHERE m.users_id = :users_id " +
"AND m.created_at = :now", nativeQuery = true)
boolean existsByUserAndCreatedAtBetween(Long users_id, LocalDate now);

@Query(value = "SELECT * FROM Memoir m WHERE m.users_id = :users_id " +
@Query(value = "SELECT * FROM memoir m WHERE m.users_id = :users_id " +
"AND m.created_at = :dateTime", nativeQuery = true)
Optional<Memoir> findByCreatedAt(Long users_id, LocalDate dateTime);

Expand Down

0 comments on commit def2ad8

Please sign in to comment.