[hibernate-issues] [Hibernate-JIRA] Created: (ANN-669) More then one @Id silently fail

Hontvári József (JIRA) noreply at atlassian.com
Sun Oct 28 15:07:39 EDT 2007


More then one @Id silently fail
-------------------------------

                 Key: ANN-669
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-669
             Project: Hibernate Annotations
          Issue Type: Bug
    Affects Versions: 3.3.0.ga
         Environment: Hibernate 3.2.5, MySQL
            Reporter: Hontvári József
            Priority: Minor


If two fields have @Id and the class has no @IdClass annotation  then the first(?) field will disappear from Hibernate metadata. I.e. you will see in the log in a "EntityLoader Static select for entity..." entry that the select doesn't contain the field. 
(If you add an @IdClass or leaves only one @Id annotation makes the column appear again.)

The first problem is that is doesn't say anything, even on trace logging level, it just fails in a strange way. 

The second is that I belive the @IdClass shouldn't be required anyway. There is a similar construct in the xml mapping using the composite-id element: if no primary key class is supplied then the entity class itself become the key class. This is not as rude as it seems, just imagine a class of which all attributes are part of the primary key.



-- 
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