openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gwo58ns <gwo5...@gmail.com>
Subject Join with partial composite key fails
Date Tue, 02 Jun 2009 12:53:22 GMT

I have 2 tables that I'm trying to do a left outer join on.


Code:
"FROM Family AS f INNER JOIN f.personVersion AS pv
LEFT OUTER JOIN pv.personDetails"

I see this as a one-to-many relationship between the Primary Key in
Person_Version and one of the Primary Keys in Person_Details.


When I run this it give me the following exception:

  Reason: org.hibernate.AnnotationException: A Foreign key refering
com.PersonDetails from com.PersonVersion
  has the wrong number of column. should be 2


I'm only trying to join on the one column.  Is this not possible to do?

TABLES

PERSON_VERSION
KEY TYPE COLUMN NAME REF TABLE REF COLUMN

PK_PERSON_VERSION Primary PERSON_VERSION_ID 
FK1_PRSN_VRSN Foreign EVENT_ID EVENT EVENT_ID


PERSON_DETAILS

KEY TYPE COLUMN NAME REF TABLE REF COLUMN

PK_PERSON_DETAILS Primary PERSON_ID, PERSON_VERSION_ID
FK1_PERSON_DTLS Foreign PERSON_VERSION_ID PERSON_VERSION
PERSON_VERSION_ID[/b]
my orm.xml is as follows:





        

        
        
            
        
        
            
                
            
              
           
                
                    
                                       
                
                
                    
                    
                
                    
	
    



    
        

        
       
            
        
        
            
        
        
            
                
            
        
    



My Person_Version class :

Code:
@Entity
public class PersonVersion extends BaseEntity {

    
    private static final long serialVersionUID = 1L;

    
    private PersonDetails  personDetails;

......
}
-- 
View this message in context: http://n2.nabble.com/Join-with-partial-composite-key-fails-tp3011851p3011851.html
Sent from the OpenJPA Developers mailing list archive at Nabble.com.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message