Allow JoinTable & JoinColumns to map oneToOne relationship using a join table 
with multiple columns.
----------------------------------------------------------------------------------------------------

                 Key: OPENJPA-725
                 URL: https://issues.apache.org/jira/browse/OPENJPA-725
             Project: OpenJPA
          Issue Type: New Feature
            Reporter: brian yoder
            Priority: Minor


When trying to map a oneToOne relationship using a JoinTable it complains:

[9/16/08 9:29:59:932 PDT] 00000029 SystemErr     R 
<openjpa-1.0.1-r420667:592145 fatal user error> 
org.apache.openjpa.persistence.ArgumentException: You have supplied columns for 
"com.sscims.im.entity.Ecase.sourceEmail<element:class java.lang.Object>", but 
this mapping cannot have columns in this context.

Here is an example from Hibernate of what I am trying to do:

        @OneToOne
    @JoinTable(
            name="ct_email_msg",
            joinColumns={
                @JoinColumn(name="email_entity_type", 
referencedColumnName="'ecaseEmail'"),
                @JoinColumn(name="email_entity_id", 
referencedColumnName="ecase_id"),
                @JoinColumn(name="email_type", referencedColumnName="'" + 
CtEmailMsg.TYPE_RECEIVED + "'")
            },
            [EMAIL PROTECTED](name="entity_attachment_id", 
referencedColumnName="entity_attachment_id")   
        )       
        public CtEmailMsg getSourceEmail() {
                return sourceEmail;
        }


Basically I have a join table (reference table) that has a three column primary 
key.  But it has a oneToOne relationship to another object, so I need to be 
able to join to it from my parent entity.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to