package com.lanyuanxiaoyao.bookstore.repository;

import com.lanyuanxiaoyao.bookstore.entity.Chapter;
import com.lanyuanxiaoyao.service.template.repository.SimpleRepository;
import java.util.Optional;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

@Repository
public interface ChapterRepository extends SimpleRepository<Chapter> {
  @Query("select max(chapter.sequence) from Chapter chapter")
  Optional<Double> findMaxSequence(Long bookId);
}

