-->
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: Eclipse Hibernate Tools and Annotations problem
PostPosted: Wed Jul 14, 2010 12:55 pm 
Newbie

Joined: Wed Jul 14, 2010 12:33 pm
Posts: 2
Hello,

I am new to Hibernate. So I want to use the HQL editor in eclipse. My problem is that i have annotations and not xml mappings. So in the hibernate perspective in eclipse, in the New configuration screen I add my hibernate.cfg.xml file and the project. I dont have a .properties file.

I got the following error when I try to issue a simple query
Code:
org.hibernate.hql.ast.QuerySyntaxException: Player is not mapped [select p from Player p]


where Player is a class that uses annotations. Then based on some stuff i found searching i added the following line in the hibernate.cfg.xml file
Code:
<mapping class="com.my.entities.Player"/>


and now I am getting the following error
Code:
org.hibernate.MappingException: An AnnotationConfiguration instance is required to use <mapping class="com.my.entities.Player"/>


Any suggestions? Thank you


Top
 Profile  
 
 Post subject: Re: Eclipse Hibernate Tools and Annotations problem
PostPosted: Wed Jul 14, 2010 2:24 pm 
Newbie

Joined: Wed Jul 14, 2010 12:33 pm
Posts: 2
I managed to make it work. I just deleted the configuration, and created a new one. And then it worked.


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.