-->
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: composite-element does generate join-table.... help....
PostPosted: Mon Mar 22, 2004 3:48 pm 
Newbie

Joined: Thu Feb 26, 2004 10:05 pm
Posts: 15
Hi all,

Following the example from section 18.3 of the Hibernate's reference manual, I was trying to model a many-to-many relationship between a Dictionary/DictionaryCode/Code tables. Here is how it works, DictionaryCode holds different Code's image translation for different Dictionary/Code combinations and Code also have a one-to-many association to a default Dictionary. But for some reason my join-table , e.g. DictionaryCode, wasn't not created when I export mapping to create database tables. Only Dictionary and Code table were created.

Please help me see what I did wrong.

Here are the mappings that was generated by xDoclet:

Code:
<hibernate-mapping>
    <class
        name="Dictionary"
        proxy="Dictionary"
        dynamic-update="false"
        dynamic-insert="false"
    >
        <id
            name="id"
            column="id"
            type="java.lang.Long"
        >
            <generator class="native">
            </generator>
        </id>
        <version
            name="version"
            type="timestamp"
            column="UPDT_DTS"
        />
        <property
            name="name"
            type="java.lang.String"
            update="true"
            insert="true"
            column="name"
            length="20"
            not-null="true"
            unique="true"
        />
        <property
            name="description"
            type="java.lang.String"
            update="true"
            insert="true"
            column="description"
            length="256"
            not-null="false"
            unique="false"
        />
    </class>

    <class
        name="Code"
        proxy="Code"
        dynamic-update="false"
        dynamic-insert="false"
    >
        <id
            name="id"
            column="id"
            type="java.lang.Long"
        >
            <generator class="native">
            </generator>
        </id>
        <version
            name="version"
            type="timestamp"
            column="UPDT_DTS"
        />
        <property
            name="name"
            type="java.lang.String"
            update="true"
            insert="true"
            column="name"
            length="20"
            not-null="true"
            unique="true"
        />
        <property
            name="description"
            type="java.lang.String"
            update="true"
            insert="true"
            column="description"
            length="256"
            not-null="false"
            unique="false"
        />
       <many-to-one
            name="dictionary"
            class="Dictionary"
            cascade="none"
            outer-join="auto"
            update="true"
            insert="true"
            column="dictionary_id"
            not-null="true"
        />
        <list
            name="dictionaryCodes"
            table="DictionaryCode"
            lazy="true"
            inverse="false"
            cascade="none"
        >
              <key column="code_id"  />
              <index column="code_index" />
              <composite-element class="DictionaryCode">
                <property
                  name="image"
                  type="java.lang.String"
                  update="true"
                  insert="true"
                  column="image"
                  length="80"
                  not-null="true"
                 />
                 <many-to-one
                   name="dictionary"
                   class="Dictionary"
                   cascade="none"
                   outer-join="auto"
                   update="true"
                   insert="true"
                   column="dictionary_id"
                   not-null="true"
                  />
              </composite-element>
        </list>
    </class>

</hibernate-mapping>


Thanks for any help...

--danny


Top
 Profile  
 
 Post subject: I got it ....
PostPosted: Mon Mar 22, 2004 9:08 pm 
Newbie

Joined: Thu Feb 26, 2004 10:05 pm
Posts: 15
Please ignore my posted question. It was human errors, it was looking at the SQLServer's Manager and it was disconnected from the server, so what I saw, that was missing, wasn't the latest. So it does generated the join table I wants. .... I am sorry ...


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.