This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
NetBeans build 201302132200 JDK 7u13 64-bit The IDE is not able to resolved enums when used in named queries, and will display a warning on the entity even though it works perfectly when the query is executed.
Can you provide sample query?
Hi, Please see an example of the problem below. We have a class Customer which has a named query that uses the CustomerStatus enum in the where clause to filter on customer statuses. Customer.java package com.hello.customer; import java.io.Serializable; import javax.persistence.Entity; import javax.persistence.EnumType; import javax.persistence.Enumerated; import javax.persistence.Id; import javax.persistence.NamedQuery; @Entity @NamedQuery(name = "Customer.findByStatus", query = "SELECT c FROM Customer c WHERE c.customerStatus = com.hello.customer.CustomerStatus.ACTIVE") public class Customer implements Serializable { @Id private int id; private String name; @Enumerated(EnumType.STRING) private CustomerStatus customerStatus; } CustomerStatus.java package com.hello.customer; public enum CustomerStatus { INAVCTIVE, ACTIVE } Netbeans show the following warning for the named query "Customer.findByStatus": Customer.findByStatus[50;90]: The state field path 'com.hello.customer.CustomerStatus.ACTIVE' cannot be resolved to a valid type. Customer.findByStatus[50;53]: The identification variable 'com' is not defined in the FROM clause. Hope this helps.
thanks, seems to be resolved in latest builds. at least I can't reproduce with suggested sample.
Verified with build 201303212300.