-->
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: Problem with any association and a composite-id
PostPosted: Thu May 19, 2005 5:33 am 
Newbie

Joined: Thu Oct 23, 2003 10:55 am
Posts: 11
Hello All,

I have a problem with an association between a Class and an Abstract class with the one table per concrete class stategy identified with a composite-id. An exception occurs when Hibernate read the mapping files.

Does anybody have a clue? Is there a problem with the mapping?

Thx in advance

Hibernate version: 2.1.8

Mapping documents:
Code:
    <class
        name="xxx.dto.Locomotive"
        table="TB07_LOCOMOTIVE"
        polymorphism="implicit"
        dynamic-update="false"
        dynamic-insert="false"
    >

      <composite-id
            name="id"
            class="xxx.dto.TypeMaterielKey"
        >
                     <key-property
                        name="code"
                        type="java.lang.String"
                        column="CODE_LOCOMOTIVE"
                        length="3"
                />

                     <key-property
                        name="numeroSerie"
                        type="java.lang.String"
                        column="NUM_SERIE"
                        length="32"
                />

        </composite-id>
        ....
    </class>
     <class
        name="xxx.dto.SegmentLocal"
        table="TG42_SEGMENT_LOCAL"
        dynamic-update="false"
        dynamic-insert="false"
    >

        <id
            name="id"
            column="ID"
            type="java.lang.Long"
        >
            <generator class="native">
                <param name="sequence">SG42_SEGMENT_LOCAL</param>
            </generator>
        </id>

         <any name="typeMateriel"
               meta-type="string"
               id-type="xxx.dto.TypeMaterielKey">
            <meta-value value="LOC" class="xxx.dto.Locomotive"/>
           
            <column name="TABLE_NAME"/>
            <column name="TYPE_MATERIEL_CODE"/>   
            <column name="TYPE_MATERIEL_NUM_SERIE"/>       
        </any>
    ...
    </class>


Full stack trace of any exception that occurs:
The stack trace is something like:
Code:
Wrong number of column for the property SegmentLocal.typeMateriel





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.