-->
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: same class name (different packages) in Configuration
PostPosted: Mon Sep 15, 2003 10:07 pm 
Newbie

Joined: Mon Sep 15, 2003 9:53 pm
Posts: 1
Hi,
I was wondering if it's normal that hibernate throws an exception "net.sf.hibernate.MappingException: duplicate import" when trying to add two classes with same name :

Configuration conf = new Configuration().addClass(org.hostname.one.myClass.class)
.addClass(org.hostname.two.myClass.class);

Looking in source I've noticed that you're binding the class by it's unqualified name (myClass) and not by it's full description (org.hostname.one.myClass).

I would like to make a central .xml file were I would keep all class names, so being able to load them on initialization.

What is the best practice in this case?

Thanx in advance,

Andrei.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 15, 2003 10:17 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Check the Hibernate documentation for a discussion of the <import> tag.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 16, 2003 5:09 am 
Newbie

Joined: Thu Oct 16, 2003 4:55 am
Posts: 9
Location: Berlin, Germany
having the same problem, I searched for the 'discussion' about <import>, but could only find the section 4.1.16 in the reference.
Basically it says nothing about the problem occuring already when the mappings are compiled, and so I get no chance to use the Classes with a fully qualified name. Am I missing some other part in the docu?
:olli


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.