These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: GetNamedQuery problem with <sql-query>
PostPosted: Mon May 23, 2005 5:17 am 
subj. I have an exception: NHibernate.MappingException: Named query not known. ???
I am using latest version 0.8.3


Top
  
 
 Post subject:
PostPosted: Tue May 24, 2005 3:37 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Either you misspelled the name, or it's a bug (or maybe an unimplemented feature).


Top
 Profile  
 
 Post subject: Another Cause of this Error....
PostPosted: Thu Feb 21, 2008 6:58 am 
Newbie

Joined: Wed Jan 30, 2008 2:35 pm
Posts: 2
There are already some posts elsewhere which list the cause of this error as having the <query/> or <sql-query/> tag inside the <class/> tag in the mapping - Move your <query/> tag outside the <class/> tag and all is well - BUT... this didn't work for me!

After several hours of debugging, I finally worked out what was wrong - I'd given one of my mapping files the wrong extension. I usually use (.hbm.xml) rather than simply (.hbm) so that visual studio more easily recognises them as XML files. BUT.. on one of my files I'd simply used a (.xml) extention by mistake, and didn't spot this as they all end in (.xml).

Because NH didn't recognise the file extension, it didn't even compile it in at application start, so when I tried to perform a GetNamedQuery() it didn't have a clue what I was on about.

If you get this error message, check the name of your mapping file FIRST before going looking for a more complicated cause of failure.

Regards
Simon


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.