Filtro de postulante por Tecnologia o Nivel

parent c492342c
package com.roshka.controller;
import java.util.List;
import javax.validation.ConstraintViolationException;
import com.roshka.modelo.Postulante;
import com.roshka.modelo.PostulanteTecnologia;
import com.roshka.repositorio.PostulanteRepository;
import com.roshka.repositorio.TecnologiaRepository;
......@@ -64,4 +67,6 @@ public class PostulanteController {
.body(ex.getMessage());
}
}
......@@ -63,10 +63,4 @@ public class PostulanteTecnologia {
}
}
package com.roshka.repositorio;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import com.roshka.modelo.Postulante;
import com.roshka.modelo.PostulanteTecnologia;
public interface PostulanteRepository extends JpaRepository<Postulante,Long> {
@Query("select pos from Postulante pos join PostulanteTecnologia pt on pt.postulante.id=pos.id "+
"join Tecnologia tec on pt.tecnologia.id=tec.id "+
"where tec.nombre=?1 and pt.nivel=?2")
public List<Postulante> findByPostulanteTecnologiaM(String tecno,long idt);
}
package com.roshka.repositorio;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import com.roshka.modelo.PostulanteTecnologia;
public interface PostulanteTecnologiaRepository extends JpaRepository<PostulanteTecnologia,Long>{
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment