-->
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.  [ 4 posts ] 
Author Message
 Post subject: org.hibernate.DuplicateMappingException: duplicate import
PostPosted: Wed Sep 16, 2009 6:25 am 
Newbie

Joined: Wed Sep 16, 2009 6:20 am
Posts: 6
Hello

I want to use Hibernate in a big size project.

The project have 1000's of classes(entities) and its Obvious to have some classes with same name in different packages.

Hibernate is not allowing to have this and i am getting the following error:
org.hibernate.DuplicateMappingException: duplicate import

Please suggest any workaround.

Thanks & Regards

Amit


Top
 Profile  
 
 Post subject: Re: org.hibernate.DuplicateMappingException: duplicate import
PostPosted: Wed Sep 16, 2009 6:57 am 
Senior
Senior

Joined: Tue Oct 28, 2008 10:39 am
Posts: 196
If you are using Annotations try @Entity(name="f.q.p.NameOfClass"), if you are using hbm.xml try using auto-import="false". (That's part of the exception!)


Top
 Profile  
 
 Post subject: Re: org.hibernate.DuplicateMappingException: duplicate import
PostPosted: Wed Sep 16, 2009 7:04 am 
Newbie

Joined: Wed Sep 16, 2009 6:20 am
Posts: 6
Hi

Thanks, this has solved my problem. I sitill have one doubt, in HQL query we only specify Class-Name, then which class will be used?

Thanks

Amit


Top
 Profile  
 
 Post subject: Re: org.hibernate.DuplicateMappingException: duplicate import
PostPosted: Wed Sep 16, 2009 8:57 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
You could apply an alias.

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


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