[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-6620) @TableGenerator-governed sequence table insertion problems

Laird Nelson (JIRA) noreply at atlassian.com
Wed Aug 31 08:34:02 EDT 2011


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

Laird Nelson commented on HHH-6620:
-----------------------------------

Also affects version 3.6.7.Final; to test, add {{-DhibernateVersion=3.6.7}} to the Maven command line.

I would edit the version field directly but don't see any way to edit the bug.

> @TableGenerator-governed sequence table insertion problems
> ----------------------------------------------------------
>
>                 Key: HHH-6620
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6620
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: annotations, core
>    Affects Versions: 3.5.0-Final
>         Environment: May affect other versions besides 3.5.0-Final
>            Reporter: Laird Nelson
>              Labels: jpa2
>         Attachments: hhh-6620.zip
>
>
> The JPA specification is admittedly mum on this, but Hibernate serves up some surprising behavior.
> Suppose you have a sequence table that is created according to the requirements of a particular {{@TableGenerator}} annotation.  So two columns, storing a sequence name and a sequence value.  Suppose this sequence table is created by some DDL script somewhere, and Hibernate's automatic schema creation is deliberately switched off.
> Hibernate will helpfully insert new rows into this table as required, but when it does so it does not honor the {{initialValue}} attribute of the {{@TableGenerator}} annotation in question.
> I will supply a test case once I get the bug number.
> The workaround is obviously to manually insert a row into this table with the appropriate initial value, but then of course the {{initialValue}} attribute is largely useless.
> OpenJPA handles this case flawlessly.
> EclipseLink doesn't even attempt to perform the insertion.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list