[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-4861) The primary key type of a derived identity is not correct

Steve Ebersole (JIRA) noreply at atlassian.com
Wed Jan 27 22:39:30 EST 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-4861?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=35390#action_35390 ] 

Steve Ebersole commented on HHH-4861:
-------------------------------------

Well the assumption being made here is that you can directly look things up based on the underlying (aka db) PK type.  I mean even if this were not handled as an embedded component, why would the id type not logically be a Person?

Think of it like this, if you had a composite id (@EmbeddedId), is it valid to say:
em.find( MyEntity.class, new Object[] { componentSub1, componentSub2, ... } );

If the *spec* says (not the tck says) we have to support it we'll have to support it...

> The primary key type of a derived identity is not correct
> ---------------------------------------------------------
>
>                 Key: HHH-4861
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4861
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: annotations
>    Affects Versions: 3.5.0-Beta-3
>            Reporter: Emmanuel Bernard
>
> In org.hibernate.test.annotations.derivedidentities.e4.a
> The main entity (Person) has an id of type String
> The derived entity (MedicalHistory) has an id of type 
> {code}@Id @OneToOne @JoinColumn Person{code}
> The TCK expects to be able to do
> em.find(MedicalHistory.class, "ssn");
> but we do map MedicalHistory id as a core-stype embedded id so the PK is MedicalHistory

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list