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: Problem with CreateQuery
PostPosted: Wed Apr 04, 2007 8:57 am 
Newbie

Joined: Wed Apr 04, 2007 8:36 am
Posts: 1
Im new in NHibernate, can any help me. I wast trying to retrieve the data thru CreateQuery and this error appears...

NHibernate.QueryException: in expected: <end-of-text> (possibly an invalid or unmapped class name was used in the query) [Select accountid, name, model from camera]

This is the code:

ISession session = DataAccessHelper.OpenSession();
IList ILCamera = session.CreateQuery("Select accountid, name, model from camera").List();

grdCamera.DataSource = ILCamera;

Camera is the table from MySQL server database. All I need is 3 fields from the table and even I put all the fields from the query statement, it causes the same error..



Plz.. Help...


Top
 Profile  
 
 Post subject: Mappings/Classes?
PostPosted: Wed Apr 04, 2007 12:42 pm 
Regular
Regular

Joined: Sun Jan 21, 2007 4:33 pm
Posts: 65
Post your mappings and classes please.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 04, 2007 2:31 pm 
Senior
Senior

Joined: Mon Aug 21, 2006 9:18 am
Posts: 179
Remember that HQL is case sensitive for your custom entitites. Be sure 'camera' is the name of your class and not 'Camera'
MIKE

_________________
If this helped...please remember to rate it!


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.