Pattern selector

Most relevant patterns first. Most helpful ones displayed. Click here to show all.

  1. SessionImpl.createQuery() has thrown a QuerySyntaxException
    Hibernate Core
    1
    0
    0
  2. HQL syntax error
    Hibernate Core
    44
    8
    4

Your stack trace compared to the selected pattern

Jump to solutionsExpand frames
org.hibernate.hql.internal.ast.QuerySyntaxException: Unable to locate class [JunctionManagementListDto] [SELECT new JunctionManagementListDto(c.siteId, c.name, c.ip, c.customer.id, zm.zone.name) FROM com.traff.hibernate.model.Controllers c, com.traff.hibernate.model.ZoneControllerMapping zm WHERE c.siteId = zm.controller.siteId ]
    at org.hibernate.hql.internal.ast.QuerySyntaxException.convert(QuerySyntaxException.java:54)
    at org.hibernate.hql.internal.ast.QuerySyntaxException.convert(QuerySyntaxException.java:47)
    at org.hibernate.hql.internal.ast.ErrorCounter.throwQueryException(ErrorCounter.java:79)
    at org.hibernate.hql.internal.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:255)
27 frames hidden

Solution

Mohd Salauddin3 months ago

A frequent problem is aliasing. Take this example:

from Cat as cat
    inner join cat.mate as mate
    left outer join cat.kittens as kitten

Here Cat table has mate and kitten as collections , we should use cat.mate to refer, not just mate. Same for kittens.

An other likely case is that you use explicit join. Check this stack overflow post on how to avoid it.

External results for this pattern (10)

  1. amondel2via GitHub3 weeks ago
    unexpected AST node: query [DELETE test.UserRole userRole WHERE ()]; nested exception is org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected AST node: query [DELETE test.UserRole userRole WHERE ()]
    Show stack trace
  2. bharathvia Stack Overflow5 months ago
    org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: afs near line 1, column 554 [select s.studentAdmissionId as studentAdmissionId, pd.rollNum as rollNum ,s.firstname as firstName , s.lastname as lastName , m.className as className,sec.sectionName as sectionName,sum(fcm.feeAmount) as totalAmount from com.rasvek.cg.entity.StudentDetails s, com.rasvek.cg.entity.StudentPresentClassDetails pd, com.rasvek.cg.entity.MasterCampusClass m ,com.rasvek.cg.entity.MasterCampusSection sec ,com.rasvek.cg.entity.FeeClassMapping fcm,com.rasvek.cg.entity.AssocFeeStudent afs where pd.studentAdmissionId = afs.studentDetails.studentAdmissionIdand afs.feeCategory.feeCatId=fcm.feeCategory.feeCatIdand s.studentAdmissionId =afs.studentDetails.studentAdmissionIdand m.classId=pd.classIdand pd.presentSectionId = sec.sectionIdand fcm.masterCampusClass.classId=pd.classId group by afs.studentDetails.studentAdmissionId]
    Show stack trace
  3. Dirk weilvia Hibernate JIRA5 months ago
    org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected end of subtree [select e from de.gedoplan.buch.eedemos.entity.Employee e where e.skills is not empty ]
    Show stack trace
  4. Mark Jeffreyvia Hibernate JIRA5 months ago
    org.hibernate.hql.internal.ast.QuerySyntaxException: Invalid path: 'org.hibernate.bugs.model.CAPSPhoneType.MOBILE' [SELECT new org.hibernate.bugs.model.PhoneTypeReport(p.id, value(p1), value(p2)) from org.hibernate.bugs.model.Person p LEFT JOIN p.capsPhoneType p1 ON KEY(p1) = org.hibernate.bugs.model.CAPSPhoneType.MOBILE LEFT JOIN p.capsPhoneType p2 ON KEY(p2) = org.hibernate.bugs.model.CAPSPhoneType.LAND_LINE ]
    Show stack trace
  5. NoobEditorvia Stack Overflow5 months ago
    Error creating bean with name 'movieController': Unsatisfied dependency expressed through field 'movieServices'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'movieServices': Unsatisfied dependency expressed through field 'movies'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'movieDao': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Validation failed for query for method public abstract java.util.List com.interview.intuit.Dao.MovieDao.findByInCinemas(boolean)!
    Show stack trace
  6. Invalid path: 'returnitRest.ReturnStatus.itemToArrive' [SELECT e FROM returnitRest.Ereturn e WHERE e.shipper.id = :shipper AND e.status = returnitRest.ReturnStatus.itemToArrive AND e.disabled = :disabled]
    Show stack trace
  7. mogudyvia GitHub5 months ago
    org.hibernate.hql.internal.ast.QuerySyntaxException: Invalid path: 'account1.id' [select vwAccount from com.ionsay.nbms.account.model.view.VwAccount vwAccount where account1.id in (?1)]; nested exception is java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: Invalid path: 'account1.id' [select vwAccount from com.ionsay.nbms.account.model.view.VwAccount vwAccount where account1.id in (?1)]
    Show stack trace
  8. Douglasvia Stack Overflow5 months ago
    with-clause referenced two different from-clause elements [select t.id, t.name, t.src_field_map.id, s1.field_map_nm as src_field_map_nm,t.tgt_field_map.id, s2.field_map_nm as tgt_field_map_nm, orm.entity.OS_Rule as t left join t.src_field_map as s1 left join t.tgt_field_map as s2 with (s1.id = t.src_field_map.id and s2.id = t.tgt_field_map.id )]
    Show stack trace
  9. f.khantsisvia Stack Overflow5 months ago
    unexpected token: ( near line 1, column <column of the derived table open param [<select statement>]
    Show stack trace
  10. Emond Papegaaijvia Hibernate JIRA5 months ago
    org.hibernate.hql.internal.ast.QuerySyntaxException: Invalid path: 'generatedAlias1.name' [select treat(generatedAlias0 as org.hibernate.bugs.SmellyCheese) from org.hibernate.bugs.Cheese as generatedAlias0 where generatedAlias1.name=:param0]
    Show stack trace