openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From twelveeighty <>
Subject Inner enum cannot be used as literal in JPQL
Date Sat, 04 Jan 2014 22:50:37 GMT
Can someone confirm whether or not this is a known issue, or if this is a
known limitation? 
When I define an  enum as part of my entity class, I am not able to use its
values as literals in a JPQL statement:

package com.myorg.jpa;
public Foo {
	public enum FooType { FOO, BAR }
	private FooType type;

select f from Foo f where f.type = com.myorg.jpa.Foo.FooType.BAR

Error message: Attempt to query field "com.myorg.jpa.Foo.FooType.BAR" from
non-entity variable "com". Perhaps you forgot to prefix the path in question
with an identification variable from your FROM clause?

My version: OpenJPA 2.3.0-nonfinal-1540826

However, if I take FooType and define it as its own Enum class
(com.myorg.jpa.FooType) the literal com.myorg.jpa.FooType.BAR works as

Should I log a bug for this?

View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message