Skip to content
Advertisement

Spring Data – The column name note_id was not found in this ResultSet

I’m getting the error “The column name note_id was not found in this ResultSet” when trying to access Postgres in spring but don’t when testing the query directly in Postgres. I’ve looked at similar questions asked but haven’t found a solution. I’m fairly new to Spring and SQL so apologies if it’s obvious. I’ve put the SQL query, database setup and stack trace below and would really appreciate you giving them a look. Also note that notes.note_user is a foreign key to user_accounts.user_id

Database:

Name: notes

enter image description here

Name: user_accounts

enter image description here

Advertisement

Answer

Delete “as noteId” and “as noteUser”, you are using native query here, not HQL

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement