-->
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.  [ 5 posts ] 
Author Message
 Post subject: net.sf.hibernate.MappingException: duplicate import: Invoice
PostPosted: Thu Jan 15, 2004 2:28 am 
Regular
Regular

Joined: Wed Dec 03, 2003 9:41 pm
Posts: 87
Can I define multi java class to one table?
I have a class map to a table. But for some reason, I should add another class map to same table. Is it ok?
My two class full name is:com.bsteel.baointl.interbid.model.InvoiceModel & com.bsteel.baointl.interbid.fee.model.InvoiceModel.
When h2 parse mapping xml, it throws Exception:
net.sf.hibernate.MappingException: duplicate import: InvoiceModel
at net.sf.hibernate.cfg.Mappings.addImport(Mappings.java:68)

at net.sf.hibernate.cfg.Binder.bindClass(Binder.java:117)

at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:183)

at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1173)

at net.sf.hibernate.cfg.Configuration.add(Configuration.java:245)

at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:268)

at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:291)

at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:935)

at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:890)

at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:860)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 15, 2004 9:02 am 
Expert
Expert

Joined: Fri Nov 07, 2003 4:24 am
Posts: 315
Location: Cape Town, South Africa
fafnir wrote:
Can I define multi java class to one table?

Certainly (I presume). The lightweight class patthen (http://hibernate.org/41.html) is an example.

I suspect the duplicate import error that you are getting is unrelated. Strip down your mappings to the minimum (i.e. two mapping files pointing to one table) and start up - if you still have problems post the stripped down mappings, java code, and debug trace.

Justin


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 15, 2004 10:02 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
The duplicate import most certainly is an DTD violation - this is a bit confusing and will be fixed in the next release. Check your log somwhere before the exception, you should find the real cause there.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 16, 2004 2:13 am 
Regular
Regular

Joined: Wed Dec 03, 2003 9:41 pm
Posts: 87
I have resolved it. I guess h2 get class name without package name as a key. So I rename my class name, that is ok.
Thank you above all.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 16, 2004 6:48 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Reference guide 5.1.16

_________________
Emmanuel


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