You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Daniel Gajdos (JIRA)" <ji...@apache.org> on 2007/06/01 15:51:16 UTC
[jira] Closed: (OPENJPA-249) problem using enum with @Enumerated
annotation in Query
[ https://issues.apache.org/jira/browse/OPENJPA-249?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Daniel Gajdos closed OPENJPA-249.
---------------------------------
Resolution: Won't Fix
Problem solved using $ in class name
> problem using enum with @Enumerated annotation in Query
> -------------------------------------------------------
>
> Key: OPENJPA-249
> URL: https://issues.apache.org/jira/browse/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:
> @Entity
> public class Application {
> ...
> @ManyToOne(optional = false)
> @JoinColumn(name = "C_APPLICATION_STATUS",
> nullable = false)
> private ApplicationStatus applicationStatus;
> ...}
> @Entity
> public class ApplicationStatus {
> public static enum Code {
> created
> }
> @Id
> @Column(name = "C_CODE")
> @Enumerated(EnumType.STRING)
> 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 http://forums.oracle.com/forums/thread.jspa?threadID=506389&tstart=45
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.