-->
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.  [ 2 posts ] 
Author Message
 Post subject: many-to-many mapping doubt
PostPosted: Fri Sep 09, 2005 7:22 am 
Beginner
Beginner

Joined: Mon Jun 20, 2005 3:14 pm
Posts: 33
Hi,

I have these xml files:

Code:
<hibernate-mapping package="br.atech.atendeCOS.model" default-lazy="false">

    <class name="Perfil" table="TB_DESCRICAO_PERFIL" schema="ADMCOS">
   
        <id name="codigo" type="short">
            <column name="COD_PERFIL" precision="3" scale="0" />
            <generator class="increment" />
        </id>
       
        <property name="descricao" type="string">
            <column name="DESC_PERFIL" length="50" not-null="true" />
        </property>

        <bag name="funcionalidades" table="TB_PERMISSAO_PERFIL">
            <key column="COD_PERFIL" not-null="false" />
            <many-to-many class="Funcionalidade">
              <column name="NOME_FUNCAO" />
              <column name="COD_SISTEMA" />
            </many-to-many>
        </bag>

    </class>
   
</hibernate-mapping>


Code:
<hibernate-mapping package="br.atech.atendeCOS.model" default-lazy="false">

  <class name="Funcionalidade" table="TB_FUNCIONALIDADE" schema="ADMCOS">
      
    <composite-id>
      <key-property name="nome" type="string">
        <column name="NOME_FUNCAO" length="30" />
      </key-property>
      <key-property name="sistema" type="short">
        <column name="COD_SISTEMA" precision="3" scale="0" />
      </key-property>
    </composite-id>      
   
    <many-to-one name="sistema" class="Sistema" update="false" insert="false">
      <column name="COD_SISTEMA" precision="3" scale="0" not-null="true" />
    </many-to-one>
         
  </class>
 
</hibernate-mapping>



In my model, TB_PERMISSAO_PERFIL is an association table.

When I try to create a SessionFactory using Hibernate Tools I receive the error: "org.hibernate.MappingException:component class not found: br.atech.atendeCOS.model.Funcionalidade"

What is wrong with my many-to-many mapping?

Thanks,

Andre


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 09, 2005 8:18 am 
Beginner
Beginner

Joined: Mon Jun 20, 2005 3:14 pm
Posts: 33
Problem solved (mapping configuration in Hibernate Tools)


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