• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Hibernate query not mapped

 
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have the following line of code that's not running.



I'm getting the following error message.



Here is my mapping in poll1.hbm.xml. The table is capitalized the same way, so I'm confused. Any ideas?


This is hibernate.cfg.xml
 
Ranch Hand
Posts: 662
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First, I'd check if you've entered poll1 or polll.
Second, I'd see if we have can declare package definiton of the class in a separate xml attribute, like in "<hibernate-mapping package=""> and remove "model." from the name attribute.

 
Frank Serkland
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Arun Kumarr wrote:First, I'd check if you've entered poll1 or polll.



I definitely have poll1, so that is correct.

Arun Kumarr wrote:Second, I'd see if we have can declare package definiton of the class in a separate xml attribute, like in "<hibernate-mapping package=""> and remove "model." from the name attribute.



I just tried that. It didn't work.
 
Frank Serkland
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Frank Serkland wrote:I definitely have poll1, so that is correct



For some reason, I had to change poll1 to Poll1, I guess because my model class is capitalized. Anyway, the line that was giving me problems works now. Go figure.
 
Bartender
Posts: 4116
72
Mac TypeScript Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Frank Serkland wrote:For some reason, I had to change poll1 to Poll1...


Same reason why you got that error... You work with Objects (Classes for that matter) in ORM so exact name should be used.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic