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

Laird Nelson (JIRA) noreply at atlassian.com
Tue Aug 30 20:23:02 EDT 2011


@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


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