package com.toyshop.repository;

import com.toyshop.entity.ProductImage;
import com.toyshop.entity.Product;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
import java.util.Optional;

public interface ProductImageRepository extends JpaRepository<ProductImage, Long> {
  List<ProductImage> findByProduct(Product product);
  Optional<ProductImage> findTopByProductOrderBySortOrderAsc(Product product);
  void deleteByProduct(Product product);
}
