
package com.dacrt.SBIABackend.repository;

import java.util.Optional;

import javax.transaction.Transactional;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import com.dacrt.SBIABackend.entity.Applications;
import com.dacrt.SBIABackend.entity.Channels;
import com.dacrt.SBIABackend.entity.Evalprocapps;
import com.dacrt.SBIABackend.entity.Processes;
import com.dacrt.SBIABackend.security.entity.Users;

@Repository
public interface EvalprocappsRepository extends JpaRepository<Evalprocapps,Integer>,JpaSpecificationExecutor<Evalprocapps>{
	boolean existsById(Integer id);
	
	@Query(value=" SELECT u FROM Evalprocapps u WHERE u.id= ?1 ")
	Evalprocapps getById(int id);
	
	@Query(value=" SELECT max(u.id) FROM Evalprocapps u")
	int getMaxRecord();
	
	@Transactional
	@Modifying
	@Query(" DELETE FROM Evalprocapps e where e.id = ?1 ")
	void deleteEvalprocappsbyid(Integer id);
}