Skip to content

Commit

Permalink
style: reflect changes from conversation id renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
becooq81 committed Jul 22, 2024
1 parent 327b4c7 commit fb4ac66
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package org.poolc.api.message.repository;

import java.util.Optional;

import org.poolc.api.conversation.domain.Conversation;
import org.poolc.api.message.domain.Message;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
Expand All @@ -11,8 +13,8 @@

@Repository
public interface MessageRepository extends JpaRepository<Message, Long> {
@Query("select m from Message m where m.conversation.id=(:id)")
List<Message> findAllByConversationID(@Param("id") String conversationId);

List<Message> findAllByConversationId(String conversationID);

@Query("SELECT m FROM Message m WHERE m.conversation.id = :conversationId ORDER BY m.createdAt DESC")
Optional<Message> findTopByConversationIdOrderByCreatedAtDesc(@Param("conversationId") String conversationId);
Expand Down

0 comments on commit fb4ac66

Please sign in to comment.