package com.ecep.contract.cloud.u8;

import java.util.List;
import java.util.Optional;

import org.springframework.data.jpa.repository.Modifying;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.ecep.contract.ds.MyRepository;
import com.ecep.contract.model.CloudYu;
import com.ecep.contract.model.Company;

@Repository
public interface CloudYuRepository extends MyRepository<CloudYu, Integer> {

    List<CloudYu> findAllByCompanyId(Integer companyId);

    Optional<CloudYu> findByCompanyId(Integer companyId);

    @Modifying
    @Transactional
    int deleteAllByCompany(Company company);

}
