Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

128
Views
Spring @Query con caracteres inferiores y comodines

Esta pregunta se refiere a Spring Data JPA.

Necesito un @Query (nativo) con la función inferior y comodines. Pero no consigo que funcione.

Aquí hay una versión simplificada de lo que estoy buscando:

 @Query(value = "SELECT * FROM CAR c WHERE LOWER(c.model) LIKE LOWER(%:model%)", nativeQuery = true) List<Car> findByModelMatching( @Param("model") String model );

INFERIOR (%: modelo%) -> ¡no funciona! INFERIOR (: modelo) -> ¡funciona!

Soy consciente de que dicha consulta se puede reescribir fácilmente como:

 List<Car> findByModelContainingIgnoreCase( String model );

Pero no estoy buscando una consulta con nombre.

Mi pregunta es: ¿Cómo combinar LOWER (o incluso UPPER) con WildCards en una @Query!

Salud

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

La función LOWER acepta cadenas, debe escribir LOWER('%' || :model || '%') si está en Oracle, por ejemplo.

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!