TypedQuery q = em.createQuery(c);
List result = q.getResultList();
lineItems is an attribute of the CustOrder and is a type of OrderLineItem.
quantity is an integer of OrderLineItem.
I got this from Hibernate , which cannot take a Join as a Root? The from expression is missing a root in the subquery in Hibernate.
Target exception: java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: ) near line 1, column 197 [select generatedAlias0 from salesapp.CustOrder as generatedAlias0 inner join generatedAlias0.lineItems as generatedAlias1 where generatedAlias1.quantity=(select max(generatedAlias1.quantity) from )]
posted 1 year ago
Hi, I tried to fix this issue by updating the pom.xml so that I get the latest Hibernate entitymanager and provider.
In Netbean 8.2,
I did this:
//In pom.xml, the original version is 4.0.0CR7. Now, I updated it to 4.3.11.Final. There is a 5.2.10 version, but Netbean does not download this latest version.
//In persistence.xml, it was org.hibernate.ejb.HibernatePersistenceProvider
<persistence-unit name="myPU" transaction-type="RESOURCE_LOCAL">
It compiles fine. But when I run it, I got this error, saying that it cannot find the provider;
... 3 more
Caused by: org.hibernate.engine.jndi.JndiException: Error parsing JNDI name 
Caused by: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
It wasn't my idea to go to some crazy nightclub in the middle of nowhere. I just wanted to stay home and cuddle with this tiny ad:
how do I do my own kindle-like thing - without amazon