Search by fields of enum type using Hibernate doesn't work

Issue #19 open
Former user created an issue

Context: org.hibernate:5.4.1.Final org.hibernate.validator:hibernate-validator:6.0.15.Final org.postgresql:postgresql:42.2.5 org.springframework.boot:spring-boot-starter-parent:2.1.4.RELEASE com.querydsl:4.2.1 org.bitbucket.gt_tech:spring-data-querydsl-value-operators:4.0.0

The main difference with the (Example application) is that Hibernate with JPA annotations (javax.persistence.Entity etc) is used for ORM

Problem description Search by fields of enum type fails with exception.

Request example: http://localhost:8080/api/v1/user?authorisation=ADMIN&size=25&page=0

Entity example: @Entity public class PortalUser implements Serializable, Persistable<Long> {
... private enum Authorisation;
...
}

Error description: The "ADMIN" string value passed as request parameter is cot converted to Authorisation enum, therefore Hibernate can't process it and throws an exception.

Please find the stack trace in attachments.


Hello!

Hibernate is probably the most widely used ORM provider. Therefore it would be great to reach full compatibility with it.

Please let me know if an example application would be helpful and I will manage to provide it. alexey.kudinov@t-systems.com

Thanks in advance!

Comments (2)

  1. GT Tech repo owner

    It appears that library is misconfigured? Can you share how you are using the library? It by default attempts to convert the values so conversion process is only delayed through advanced features which should be enabled in entirety, possible to share more details?

    Usage of Hibernate has no effect on this library’s use in given problem statement context.

  2. Log in to comment