• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate query not mapped

 
Frank Serkland
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • 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
 
Arun Kumarr
Ranch Hand
Posts: 661
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • 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: 106
  • Mark post as helpful
  • send pies
  • 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: 106
  • Mark post as helpful
  • send pies
  • 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.
 
Vijitha Kumara
Bartender
Posts: 3914
9
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic