aspose file tools*
The moose likes Object Relational Mapping and the fly likes Hibernate query not mapped Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate query not mapped" Watch "Hibernate query not mapped" New topic
Author

Hibernate query not mapped

Frank Serkland
Ranch Hand

Joined: Jun 21, 2010
Posts: 104
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

Joined: May 16, 2005
Posts: 513

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.


If you are not laughing at yourself, then you just didn't get the joke.
Frank Serkland
Ranch Hand

Joined: Jun 21, 2010
Posts: 104
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

Joined: Jun 21, 2010
Posts: 104
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

Joined: Mar 24, 2008
Posts: 3829

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.


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate query not mapped