I have example web application Hibernate 4.3.5 + Derby database 10.10.1.1+ Glassfish4.0 with IDE NetBeans 8.0Beta.
I have the next exception:
Caused
May be this will make it more clear, and of course makes sense too.
@Entity
@Table(name = "users")
/**
*
* @author Ram Srinvasan
* Use class name in NamedQuery
* Use table name in NamedNativeQuery
*/
@NamedQueries({ @NamedQuery(name = "findUserByName", query = "from User u where u.name= :name") })
@NamedNativeQueries({ @NamedNativeQuery(name = "findUserByNameNativeSQL", query = "select * from users u where u.name= :name", resultClass = User.class) })
public class User implements Principal {
...
}