Home » Support » Issue Tracking » @Enumerated(EnumType.STRING) annotation inhibits proper execution of IN expressions.

@Enumerated(EnumType.STRING) annotation inhibits proper execution of IN expressions.

Type: BugPriority: NormalStatus: FixedReplies: 1
#1

When the following annotation is present on an enum type entity field:

@Enumerated(EnumType.STRING)

Queries using JPQL IN expressions on this field won't work correctly anymore. This issue has been described in forum post 681 (JPA JPQL WHERE clause for IN :variable not working if variable is a list of Enums).

See also the attached test case (play with adding and removing the Enumerated annotation).

Best regards, and thank you for this great piece of work!

#2

Thank you for this report. The bug can be easily repeated by changing the example in forum post #1254 to @Enumerated(EnumType.STRING), as your suggestion.

It happened because ObjectDB considered a collection of emum values as a query parameter argument to be always @Enumerated(EnumType.ORDINAL). This is fixed now in build 2.6.1_05.

 

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

Post Reply

To post a reply and/or subscribe to update notifications - please login