This content has been marked as final.
Show 2 replies
-
1. Re: Error :java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: asset is not mapped select a from asset a order by a.assetType
aravindkosuri Nov 17, 2009 6:47 PM (in response to prati)Hi,
If you want to specify select cause in your query use createNativeQuery method on EntityManager otherwise replace your query like below.
Query q = em.createQuery("FROM Asset a order by a.assetType"); or Query q = em.createNativeQuery("select a from asset a order by a.assetType");
-
2. Re: Error :java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: asset is not mapped select a from asset a order by a.assetType
prati Nov 17, 2009 7:21 PM (in response to prati)Hi,
Thanks a lot. :-)
I had actually found other workaround but what you suggested is definitely a better way.
I used full package name in query like
Query q = em.createQuery("SELECT a FROM mypackage.test.Asset a ");
Thanks once again.
Pratibha