package com.bytesw.bytebot.etl.dao;

import com.bytesw.bytebot.etl.model.Message;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;

public interface MessageRepository extends CrudRepository<Message, Long> {

    @Query("SELECT s from Message s WHERE s.sessionId = :sessionId")
    Long findLastCorrelativeBySession(@Param("sessionId") Long sessionId);
}
