Win a copy of Head First Android this week in the Android forum!
  • 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 Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

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: 4109
72
Hibernate Fedora Chrome
  • 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.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic