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.  [ 1 post ] 
Author Message
 Post subject: Bad identifier type / middlegen
PostPosted: Fri Jun 30, 2006 8:22 am 
Newbie

Joined: Fri Jun 30, 2006 8:15 am
Posts: 1
Slt,
G un soucis sans doute avec un hbm.
J'utilise middlegen pr generer les hbm ainsi que les classes java.
Aucun pb pr les tables avec un clef primaire simple, ainsi que pr les relations many to one et one to many.
Les classes générées sont parfaitement exploitables.
En revanche cela ne fonctionne pas pr les classes générées à partir de hbm construit à partir de tables ayant une clef composite.
Voici le hbm
Code:
<!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
   
<hibernate-mapping>
<!--
    Created by the Middlegen Hibernate plugin 2.2

    http://boss.bekk.no/boss/middlegen/
    http://www.hibernate.org/
-->

<class
    name="hibernate_mapping.TAsso"
    table="t_assos"
    lazy="false"
>
    <meta attribute="implement-equals" inherit="false">true</meta>

    <composite-id name="comp_id" class="hibernate_mapping.TAssoPK">
        <key-property
            name="idContact"
            column="id_contact"
            type="java.lang.Integer"
            length="10"
        />
        <key-property
            name="idMetier"
            column="id_metier"
            type="java.lang.Integer"
            length="10"
        />
    </composite-id>
</class>
</hibernate-mapping>

L'erreur à l'execution est la suivante
Quote:
INFO: building session factory
java.lang.ExceptionInInitializerError
at Test.main(Test.java:53)
Caused by: java.lang.RuntimeException: Problème de configuration : Bad identifier type: net.sf.hibernate.type.ComponentType
at com.minosis.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:15)
... 1 more
Caused by: net.sf.hibernate.MappingException: Bad identifier type: net.sf.hibernate.type.ComponentType
at net.sf.hibernate.persister.AbstractEntityPersister.<init>(AbstractEntityPersister.java:660)
at net.sf.hibernate.persister.EntityPersister.<init>(EntityPersister.java:716)
at net.sf.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:42)
at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:136)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:791)
at com.minosis.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:13)
... 1 more
Exception in thread "main"


Je suppose que le hbm généré à des soucis ms pourriez vous m'indiquer lesquels ? Merki


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.