I'm trying to make a query using JPA criteria, it would look like this:
I'll go through 2 initial dates and a DateFinal and a vehicle's board how can I make this query?
The table that I'm going to consult would be Service and it has a car where this car would have a license plate, I think that up to that point is correct.
public List<Servico> buscarServicoDeVeiculoEntreDatas(Date diaServico, Date diaGarantia, Carro carro) {
CriteriaBuilder builder = manager.getCriteriaBuilder();
CriteriaQuery<Servico> criteriaQuery = builder.createQuery(Servico.class);
Root<Servico> s = criteriaQuery.from(Servico.class);
criteriaQuery.select(s);