[hibernate-issues] [Hibernate-JIRA] Commented: (EJB-364) Composite PK and @GeneratedValue

Helene Joanin (JIRA) noreply at atlassian.com
Thu Jul 2 13:27:16 EDT 2009


    [ http://opensource.atlassian.com/projects/hibernate/browse/EJB-364?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=33517#action_33517 ] 

Helene Joanin commented on EJB-364:
-----------------------------------

This bug seems to prevent to run the current version (june 2009, release 493) of the bench SpecJAppServer2008 on hibernate.

> Composite PK and @GeneratedValue
> --------------------------------
>
>                 Key: EJB-364
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-364
>             Project: Hibernate Entity Manager
>          Issue Type: Bug
>    Affects Versions: 3.3.2.GA
>         Environment: Hibernate 3.2.6
> Glassfish
> PostgreSQL
>            Reporter: Radosław Smogura
>            Priority: Critical
>
> [code]
> For class like this
> @Entity
> @IdClass(FooId.class)
> /* Seq / Table generator */
> public class Foo {
>   int id1;
>  int id2;
> @Id
> public getId1() {
> return id1;
> }
> public setId1(....);
> @Id
> @GeneratedValue(strategy=AUTO/IDENTITY/SEQUENCE/TABLE)
> public int getId2() {
> return id2;
> }
> public void setId2(.....);
> }
> [/code]
> Id1 is set manully, but id2 is unchanged i this situation hibernate doesn't generates PK and tries to insert NULL  causing error.
> Specification requires assigning of generated value with @Id properties. Part 2.4.1 defines two types of PKs simple and composite and part 9.1.9 says about PKs in generally.  (SEQ or IDENTITY is specification depended, but PostgreSQL support it and Hibernate should support it too).

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