Skip to main content

ChatMessage

The ChatMessage entity, mapped to the messages table.

Tablemessages
Tenant-scopedYes — extends TenantOwned
Columns4
Relationships3
Sourcebackend/src/main/java/com/motorph/payroll/model/ChatMessage.java

Columns​

FieldTypeColumnNullNotes
messageIdIntegermessage_id—primary key, generated
messageContentStringmessage_content——
sentAtLocalDateTimesent_at——
statusStringstatus——

Plus tenant_id, inherited from TenantOwned. Hibernate stamps it on insert and adds where tenant_id = ? to every query, so it is never written or read by application code.

Relationships​

FieldKindTargetJoin columnRequired
sender@ManyToOneEmployeesender_employee_idYes
recipient@ManyToOneEmployeerecipient_employee_idYes
conversation@ManyToOneConversationconversation_idYes

Neighbourhood​

Repository​

ChatMessageRepository​

Declared over ChatMessage with id type Integer. Source: backend/src/main/java/com/motorph/payroll/repository/ChatMessageRepository.java

MethodReturnsNotes
findByConversation(@Param("convId") Integer convId, Pageable pageable)Page<ChatMessage>explicit @Query
findLatestByConversation(@Param("convId") Integer convId, Limit limit)List<ChatMessage>explicit @Query
findBeforeCursorByConversation(@Param("convId") Integer convId, @Param("before") Integer before, Limit limit)List<ChatMessage>explicit @Query
markConversationMessagesRead(@Param("convId") Integer convId, @Param("empId") Integer empId)intexplicit @Query, modifying

Reached by​

These controllers hold — directly or through a service they depend on — a repository over ChatMessage.

ControllerBase pathEndpointsModule
ConversationController/api/conversations5Platform Misc

Generated page

This page is rebuilt from the source on every docs build by docs-site/scripts/gen-code-wiki.mjs. Editing it has no effect — change the code, or, if what you want to say is prose, write it in docs/.