Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: change all entity name to lowercase #52

Merged
merged 1 commit into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading