This week's book giveaway is in the Open Source Projects forum.
We're giving away four copies of Eclipse Collections Categorically: Level up your programming game and have Donald Raab on-line!
See this thread for details.
  • 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
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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
 
Sunglasses. AKA Coolness prosthetic. This tiny ad doesn't need shades:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic