package com.realnet.DataLake.Repository;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import com.realnet.DataLake.Entity.Data_lake;

@Repository
public interface Data_lakeRepository extends JpaRepository<Data_lake, Integer> {

	@Query(value = "select * from data_lake where  created_by=?1", nativeQuery = true)
	List<Data_lake> findAll(Long creayedBy);

	@Query(value = "select * from data_lake where  created_by=?1", nativeQuery = true)
	Page<Data_lake> findAll(Long creayedBy, Pageable page);

	@Query(value = "select * from data_lake where  created_by=?1 && ref_datalake_id=?2", nativeQuery = true)
	List<Data_lake> findAllByRefDatlakeId(Long creayedBy, Integer ref_datalake_id);
}