I have a situation where I have a one-to-many:

Document 1 ---> m DocumentVersion.

The document version has a composite-id.

    
  | <class name="com.eLynx.Core.Database.Entity.DocumentVersion"  
  |            table="DocumentVersion" 
  |            lazy="false">
  |     
  |         <composite-id >
  |                     <key-many-to-one name="document" 
  |                                         column="ContentId" 
  |                         class="com.eLynx.Core.Database.Entity.Document"/>   
                 
  |                                        
  |               <key-property name="version" column="Version" type="int"/>    
             
  |             <key-property name="mimeType" column="MimeType" type="string"/>
  |               </composite-id>
  |               
  |                <timestamp name="CreationDate" source="db" />
  |                       
  |         <property name="CSFileId" type="long">
  |             <column name="CSFileId" not-null="true"/>
  |         </property>
  |               
  | </class>

The Document class is a subclass:

                                
  | <!-- Document subclass definition -->
  | <subclass name="com.eLynx.Core.Database.Entity.Document"
  |                discriminator-value="D">
  |                             
  |       <list name="DocumentVersions" 
  |              table="DocumentVersion" 
  |              inverse="true" 
  |              cascade="all">
  |             
  |            <key column="ContentId"/>
  |            <index column="version"/>
  |            <one-to-many 
class="com.eLynx.Core.Database.Entity.DocumentVersion"/
  |        </list>  
  |                     
  | </subclass>
                                
I have test data where a document has one version.  When I do the load from:

           
  | Document root = (Document) session.load (Document.class, 146L);
  | List<DocumentVersion> versions = root.getDocumentVersions();
  | 

then examine the list in the debugger I see:

  | [null, [EMAIL PROTECTED]

I cannot, for the life of me, figure out why I have that null in the first 
position.  Anyone have any ideas?  Thanks in advance.


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4182233#4182233

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4182233
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to