io.mosip.admin.bulkdataupload.repositories.DeviceProviderRepository Maven / Gradle / Ivy
package io.mosip.admin.bulkdataupload.repositories;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import io.mosip.kernel.core.dataaccess.spi.repository.BaseRepository;
import io.mosip.admin.bulkdataupload.entity.DeviceProvider;
/**
* The Interface DeviceProviderRepository.
*
* @author Srinivasan
* @author Megha Tanga
* @since 1.0.0
*/
@Repository
public interface DeviceProviderRepository extends BaseRepository {
/**
* Find by id and is active is true.
*
* @param id the id
* @return the device provider
*/
DeviceProvider findByIdAndIsActiveIsTrue(String id);
@Query("FROM DeviceProvider d where d.id=?1 AND (d.isDeleted is null OR d.isDeleted = false) AND d.isActive = true")
DeviceProvider findByIdAndIsDeletedFalseorIsDeletedIsNullAndIsActiveTrue(String id);
@Query("FROM DeviceProvider d where d.id=?1 AND d.vendorName=?2 AND (d.isDeleted is null OR d.isDeleted = false) AND d.isActive = true")
DeviceProvider findByIdAndNameAndIsDeletedFalseorIsDeletedIsNullAndIsActiveTrue(String id, String vendorName);
@Query("FROM DeviceProvider d where d.vendorName=?1 AND d.address=?2 AND (d.isDeleted is null OR d.isDeleted = false) AND d.isActive = true")
DeviceProvider findByNameAndAddressAndIsDeletedFalseorIsDeletedIsNullAndIsActiveTrue(String vendorName, String address);
/*
* @Query("FROM DeviceProvider d where d.id=?1 AND d.venderName AND (d.isDeleted is null OR d.isDeleted = false) AND d.isActive = true"
* ) DeviceProvider
* findByIdAndNameIsDeletedFalseorIsDeletedIsNullAndIsActiveTrue(String id,
* String vendorName);
*/
}