-->
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: org.hibernate.MappingException: broken column mapping
PostPosted: Fri May 29, 2009 4:12 pm 
Newbie

Joined: Mon May 18, 2009 6:00 pm
Posts: 3
I have 2 tables I'm trying to do a left outer join.

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


I see this as a one-to-one relationship between the foreign key in Person_Details and the Primary Key in Person_Version

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 Person_Version class :



Code:
@Entity
public class PersonVersion extends BaseEntity {

   
    private static final long serialVersionUID = 1L;

   
    private PersonDetails  personDetails;

......
}

My ORM.xml:


Code:
  <entity class="com.PersonVersion">
        <table name="person_version" />
        <sequence-generator name="SEQ" sequence-name="SQ_person_version" allocation-size="1"/>
        <attribute-override name="id">
            <column name="person_version_id" column-definition="NUMBER(38)"/>
        </attribute-override>
        <attributes>
            <basic name="eventId">
                <column name="event_id" column-definition="NUMBER(38)" />
            </basic>
             
            <one-to-one fetch="EAGER" name="personDetails" optional="true">
                <join-column name="person_version_id" insertable="false" updatable="false"/>
                <cascade>
                    <cascade-refresh/>
                </cascade>
            </one-to-one>
        </attributes>
    </entity>


When I start my server I get the following error:


Reason: javax.persistence.PersistenceException: org.hibernate.MappingException: broken column mapping
for: personDetails.id of: com.PersonVersion


Has anyone run into this issue?


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.