Interface IMessageDAO
- All Known Implementing Classes:
MessageDAO
public interface IMessageDAO
Defines the interface for a Message DAO.
Any class implementing
IMessageDAO
must provide implementations for
creating messages and retrieving messages associated with a chat.- Author:
- Joshua M.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
createMessage
(Message message) Creates a new Message in the database.getAllChatMessages
(int chatId) Retrieves all Messages associated with a specific chat.
-
Method Details
-
createMessage
Creates a new Message in the database.- Parameters:
message
- The Message to create.- Throws:
SQLException
- If an SQL error occurs during the operation.
-
getAllChatMessages
Retrieves all Messages associated with a specific chat.- Parameters:
chatId
- The ID of the chat whose messages are to be retrieved.- Returns:
- A list of
Message
objects associated with the chat. - Throws:
SQLException
- If an SQL error occurs during the operation.
-