Lenguaje similar a sql
JPQL maneja entidades(en lgar de tablas)uy atributos de objetos(en lugar de campos )
se obtine una lista con todos los clientes
"SELECT c FROM Cliente c"
Se obtiene una lista con los DNI de todos los clientes
"SELECT c.dni FROM Cliente c"
Se obtinen una lista de todos los nombres diferentes entre los clientes
"SELECT DISTINC c.nombre FROM Cliente c"
Lista con los nombres que empiecen con j
"SELECT c.nombre FROM Cliente c WHERE c.nombre LIKE 'j%"
EJEMPLOS DE CONSULTA
SE COLOCAN EN LA INTERFACE
@Query("select u.id from other_name_for u where u.id > ?1 and u.id <?2")
List<Integer>findByIdBetween(int initial, int end)
EJEMPLOS DE BORRADO
@Modifying @Query(value="delete from other_name_for u where u.nick = ?1")
void deleteByNickQuery(int initial, int end)