Win a copy of Getting started with Java programming language this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate - Spring integration problem  RSS feed

 
james frain
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • 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? )
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'll help move it. ;)

Mark
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!