• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

Using enum property value in query annotation

 
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi

i use spring boot 2.3.2 with spring data and hibernate.

I have a Enum



I have an enitty


In my repository i tried theses solutions without success



If I do like that that working



I see some thread like this one: https://stackoverflow.com/questions/63060484/enum-in-query-get-invalid-expression who have similar issue.


thanks
 
Saloon Keeper
Posts: 26538
187
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nothing to do with Spring Boot, and if you're using Hibernate JPA with Spring Data, even the "Hibernate" part doesn't really matter, because it's a JPA thing.

Look here: https://tomee.apache.org/examples-trunk/jpa-enumerated/

The big problem with enumerations is that most databases don't support enumerations as a basic field type. So the JPA layer has to bridge the difference, and that's what the above mechanism is for.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic