The node to traverse cannot be null Hibernate SQL

0 votes

I'm using hibernate to run the following SQL query:

SELECT thi 
FROM track_history_items thi 
JOIN artists art 
  ON thi.artist_id = art.id 
WHERE thi.type = "TrackBroadcast" 
GROUP BY art.name 
ORDER thi.createdAt DESC

However, I keep getting the error message "Node to traverse cannot be null!" Anyone have any idea what might be causing this?

Aug 23, 2022 in Database by Kithuzzz
• 38,000 points
1,316 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

The part where the problem is: 

Query q = session.createQuery("from" + Menu.class.getName() + "where menuid="+menuid);

Missing spaces. Please utilize parameters as well. As an illustration, a parametrized query typically performs better (and doesn't include SQL injections).

Query q = session.createQuery("from Menu where menuid = :menuid");
q.setParameter("menuid", menuid);

I hope this helps you.

answered Aug 24, 2022 by narikkadan
• 63,600 points

edited Mar 5

Related Questions In Database

0 votes
1 answer
0 votes
2 answers

Write a SQL query to find the names of employees that begin with ‘S’

Select ename From emp Where ename like"s%"; READ MORE

answered Oct 7, 2021 in Database by anonymous
27,795 views
0 votes
1 answer

What is the SQL query to get the third highest salary of an employee from employee_table

You can try out something like this: SELECT ...READ MORE

answered Sep 27, 2018 in Database by Sahiti
• 6,370 points
13,217 views
0 votes
1 answer

List the ways in which Dynamic SQL can be executed

Following are the ways in which dynamic ...READ MORE

answered Oct 26, 2018 in Database by DataKing99
• 8,250 points
1,413 views
0 votes
1 answer

What are the different authentication modes in SQL Server? How can it be changed?

Windows mode and Mixed Mode – SQL ...READ MORE

answered Oct 29, 2018 in Database by Sahiti
• 6,370 points
1,341 views
0 votes
0 answers

could not extract ResultSet in hibernate

I am getting this exception: "HTTP Status ...READ MORE

May 20, 2022 in Java by Kichu
• 19,040 points
9,067 views
0 votes
0 answers

SQLGrammarException: could not execute query

I'm using Struts 2 and Hibernate, and ...READ MORE

Aug 21, 2022 in Database by Kithuzzz
• 38,000 points
3,232 views
0 votes
1 answer

Not equal <> != operator on NULL

Standard SQL-92 is represented by >; its ...READ MORE

answered Sep 18, 2022 in Database by narikkadan
• 63,600 points
982 views
0 votes
1 answer

IN Clause with NULL or IS NULL

An in statement will be parsed identically to field=val1 or ...READ MORE

answered Sep 20, 2022 in Database by narikkadan
• 63,600 points
820 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP