Skip to content

Commit

Permalink
feature: 채팅방목록 조회 에러 해결(#69)
Browse files Browse the repository at this point in the history
feature: 채팅방목록 조회 에러 해결(#68)
  • Loading branch information
Lee-Dahyeon authored Nov 30, 2024
2 parents 5ccd7f9 + 7b9af86 commit c595c3f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@EntityListeners(AuditingEntityListener.class)
@Table(indexes = {@Index(name = "idx_chatRoom_id_id", columnList = "chatRoom_id, id DESC")})
@Table(indexes = {@Index(name = "idx_chat_room_id_id", columnList = "chat_room_id, id DESC")})
@DynamicInsert
public class Chatting extends BaseEntity {
@Id
Expand All @@ -27,7 +27,7 @@ public class Chatting extends BaseEntity {

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(
name = "chatRoom_id",
name = "chat_room_id",
nullable = false,
foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
private ChatRoom chatRoom;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public interface ChattingRepository extends JpaRepository<Chatting, Long> {
@Query(
value =
"select c.content from chatting c where c.id = ("
+ "select MAX(id) from chatting where chatRoom_Id = :chatRoomId)",
+ "select MAX(id) from chatting where chat_room_Id = :chatRoomId)",
nativeQuery = true)
String findLastChattingContentByChatRoomId(Long chatRoomId);

Expand Down

0 comments on commit c595c3f

Please sign in to comment.