Regular |
|
Joined: Mon Apr 25, 2005 5:36 am Posts: 103
|
Dans ma classe
<class>
<id name="Id" type="java.lang.Integer">
<column name="ID" not-null="true" unique="true" sql-type="NUMBER(6)" />
<generator class="assigned" />
</id>
....
<joined-subclass name="Externe" table="EXTERNE" >
<key column="Id"/>
<property name="MontantFacturation" column="MONTANTFACTURATION"/>
</joined-subclass>
<joined-subclass name="Interne" table="INTERNE" >
<key column="Id"/>
<property name="SalaireMensuel" column="SALAIREMENSUEL"/>
</joined-subclass>
</class>
Dasn mes sous classes
<class name="fr.icdc.dei.fwk.sample.dto.Interne" table="INTERNE" schema="HIBERNATE">
<id name="Id" type="java.lang.Integer">
<column name="ID" not-null="true" unique="true" sql-type="NUMBER(6)" />
<generator class="assigned" />
</id>
<property name="SalaireMensuel" type="java.math.BigDecimal">
<column name="SALAIREMENSUEL" not-null="false" sql-type="NUMBER(8,2)" />
</property>
</class>
</hibernate-mapping>
AND
<class name="fr.icdc.dei.fwk.sample.dto.Externe" table="EXTERNE" schema="HIBERNATE">
<id name="Id" type="java.lang.Integer">
<column name="ID" scale="6" precision="0" not-null="true" unique="true" sql-type="NUMBER" />
<generator class="assigned" />
</id>
<property name="MontantFacturation" type="java.math.BigDecimal">
<column name="MONTANTFACTURATION" not-null="true" sql-type="NUMBER(8,2)" />
</property>
</class>
</hibernate-mapping>
J'ai le message d'erreur suivant
Initial SessionFactory creation failed
java.lang.ExceptionInInitializerError
at fr.icdc.dei.fwk.test.HibernateUtil.<clinit>(HibernateUtil.java:22)
at fr.icdc.dei.fwk.test.Test.main(Test.java:15)
Caused by: org.hibernate.MappingException: Error reading resource: fr/icdc/dei/fwk/sample/dto/Ressource.hbm.xml
at org.hibernate.cfg.Configuration.addResource(Configuration.java:447)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1392)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1364)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1346)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1313)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1241)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1227)
at fr.icdc.dei.fwk.test.HibernateUtil.<clinit>(HibernateUtil.java:16)
... 1 more
Caused by: org.hibernate.MappingException: duplicate import: Externe
at org.hibernate.cfg.Mappings.addImport(Mappings.java:101)
at org.hibernate.cfg.HbmBinder.bindPersistentClassCommonValues(HbmBinder.java:540)
at org.hibernate.cfg.HbmBinder.bindClass(HbmBinder.java:487)
at org.hibernate.cfg.HbmBinder.bindJoinedSubclass(HbmBinder.java:758)
at org.hibernate.cfg.HbmBinder.handleJoinedSubclass(HbmBinder.java:1791)
at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:1732)
at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:317)
at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:235)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:151)
at org.hibernate.cfg.Configuration.add(Configuration.java:358)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:395)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:444)
... 8 more
Exception in thread "main"
Qu'est-ce qui va pas dasn mon mapping?
|
|