openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Gajdos (JIRA)" <>
Subject [jira] Created: (OPENJPA-249) problem using enum with @Enumerated annotation in Query
Date Fri, 01 Jun 2007 12:40:15 GMT
problem using enum with @Enumerated annotation in Query

                 Key: OPENJPA-249
             Project: OpenJPA
          Issue Type: Bug
          Components: query
    Affects Versions: 0.9.7
         Environment: Windows XP, WAS 6.1
            Reporter: Daniel Gajdos

Situation description:
public class Application {
	@ManyToOne(optional = false)
	@JoinColumn(name = "C_APPLICATION_STATUS",
		nullable = false)
	private ApplicationStatus applicationStatus;

public class ApplicationStatus {
	public static enum Code {
	@Column(name = "C_CODE")
	private Code code;
And now the problem:
When executing query "SELECT a FROM Application a WHERE a.applicationStatus = :status" with
parameter q.setParameter("status", ApplicationStatus status); everything works fine. 
But when trying to call the query like "SELECT a FROM Application a WHERE a.applicationStatus.code
= :package.ApplicationStatus.Code.created " it fails with: Attempt to query field "package.ApplicationStatus.Code.waiting"
from non-entity class "null".
Is there any way to create a query with built in enum value? I found a similar issue on

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message