persistence@glassfish.java.net

Bug Comparing Enum with Bindingparameter

From: Christian Kerwer <Christian.Kerwer_at_t-online.de>
Date: Mon, 28 Jan 2008 15:49:40 +0100

Hello,

 

I'm experiencing a problem with NamedQueries.

In den following example in a NamedQuery an enum-field is to be compared
with an binding-parameter.

There's no reason why this is not allowed, since it is possible to bind enum
parameter with ,query.setParameter()'.

 

Toplink quits this issue with the following reason:

invalid enum equal expression, cannot compare enum value of type
[MyEnumType] with a non enum value of type [java.lang.Object]

 

Anyone an idea?