package com.smyhub.store.mengyastorebackendjava.repository;

import com.smyhub.store.mengyastorebackendjava.entity.ProductCode;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Repository
public interface ProductCodeRepository extends JpaRepository<ProductCode, Long> {

    List<ProductCode> findByProductId(String productId);

    long countByProductId(String productId);

    @Transactional
    void deleteByProductId(String productId);
}
