-->
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: hibernate mapping problem.
PostPosted: Thu Nov 16, 2006 3:25 am 
Beginner
Beginner

Joined: Wed Nov 15, 2006 4:25 am
Posts: 21
Hai Friends

I am using Hibernate 3.2 and database as MS SQL. My POJOs class is Contact and its corresponding tabls is MYCONTACT.When i am retrieving from the database by the following code

Query query = session.createQuery( "from MYCONTACT");
Iterator itr = query.iterate();
while(itr...)
{
......
..... }

It is displaying the following msg:

org.hibernate.hql.ast.QuerySyntaxError: MYCONTACT is not mapped.
[from MYCONTACT]

I have gone through all mycode but the table is mapped.It is being able to insert .

Please Help me

Thanks in Advance.[/img][/list][/list][/code][/quote][/i]


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 16, 2006 4:00 am 
Regular
Regular

Joined: Tue May 16, 2006 3:32 am
Posts: 117
If your POJO class is Contact then the query should be

"from Contact "

or you could give the fully qualified class name

"from package.Contact"


Top
 Profile  
 
 Post subject: it worked .
PostPosted: Thu Nov 16, 2006 5:00 am 
Beginner
Beginner

Joined: Wed Nov 15, 2006 4:25 am
Posts: 21
Thanks Friends

It worked

I changed my query to from package.POJO class name

Thank You


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.