package com.example.demo.data;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.TypedQuery;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.example.demo.model.Employee;

@Repository
public class Repository3_Impl implements Repository3_Interfejs {
	@Autowired
	private EntityManager em;

	public List<Employee> findAll() {
		TypedQuery<Employee> query = em.createNamedQuery("Employee.findAll", Employee.class);
		return query.getResultList();
	}
	
	public Employee findById(Integer employeeId) {
		return em.find(Employee.class, employeeId);
	}
	
}
