node to traverse cannot be null (Hibernate SQL)

前端 未结 6 1485
醉酒成梦
醉酒成梦 2021-02-12 03:23

I\'m performing a SQL query through hibernate, which looks like:

SELECT thi 
FROM track_history_items thi 
JOIN artists art 
  ON thi.artist_id = art.id 
WHERE t         


        
6条回答
  •  时光说笑
    2021-02-12 04:05

    node to traverse cannot be null!

    This is a generic Hibernate error message indicating a syntax problem in your query. As another example, forgetting to start a select clause with the word "SELECT" would yield the same error.

    In this instance the syntax error is due to the on clause - HQL does not support them. Instead do a cross join like so:

    FROM track_history_items thi, artists art 
    WHERE thi.type = "TrackBroadcast" 
    AND  thi.artist_id = art.id 
    GROUP BY art.name 
    ORDER thi.createdAt DESC
    

提交回复
热议问题