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_VERSIONKEY TYPE COLUMN NAME REF TABLE REF COLUMN
PK_PERSON_VERSION Primary PERSON_VERSION_ID
FK1_PRSN_VRSN Foreign EVENT_ID EVENT EVENT_ID
PERSON_DETAILSKEY 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?