Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Hibernate - Spring integration problem

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am getting this error when trying to query a basic table using hibernate.

org.springframework.orm.hibernate3.HibernateQueryException: products is not mapped [from products]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: products is not mapped [from products]
at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:660)


This is my Product class


This is my sessionFactory configuration


Any idea what I might be missing? I'm guessing it's correct to be using the hibernate name of the table as opposed to the logical name of it in my HQL query? My products class is fully annotated

Update: I used Product ( Table name ) in my HQL and it worked .... now I'm even more puzzled, surely the HQL should use the @hibernate@ mapped table name? ( Sorry, but i think this is now turning into a hibernate question so maybe I should move it? )
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'll help move it. ;)

Mark
 
Does this tiny ad smell okay to you?
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic