-->
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.  [ 2 posts ] 
Author Message
 Post subject: Retrieving Data From Table using hibernate
PostPosted: Thu Jan 17, 2008 3:57 pm 
Newbie

Joined: Thu Jan 17, 2008 1:12 pm
Posts: 8
I inserted data into a table by mapping collections to database.
However when i try to retrieve a row from that table it says that the table is not mapped.

I am using a list to insert Car Objects into the table named amar.
I am setting the class which has the list as a private instance as an entity and using Join tables annotations to map the car objects to the table.

This is the error i am getting into:
org.hibernate.hql.ast.QuerySyntaxException: amar is not mapped [select a From amar a ]


Is this because the Car class is not set as an entity?
Also is there a way where i can retrieve data from the table amar???


Top
 Profile  
 
 Post subject: Re: Retrieving Data From Table using hibernate
PostPosted: Thu Jan 17, 2008 4:03 pm 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
HQL deals with Entity classes and not tables. You will have to create a native query if you want to access a table directly. However, this is usually a limited and rare scenario since overdoing it defeats the whole idea behind using hibernate.



Farzad-


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.