[hibernate-issues] [Hibernate-JIRA] Created: (HHH-2347) Improvement to DerbyDialect default identy generation mode

Fabrizio Giustina (JIRA) noreply at atlassian.com
Mon Jan 8 16:31:44 EST 2007


Improvement to DerbyDialect default identy generation mode
----------------------------------------------------------

         Key: HHH-2347
         URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2347
     Project: Hibernate3
        Type: Patch

    Versions: 3.2.1    
    Reporter: Fabrizio Giustina
 Attachments: DerbyDialect-identity.diff

although derby supports identities org.hibernate.dialect.DerbyDialect strangely uses an HiLo generation strategy for ids (for any other dialects that support identities IdentityGenerator is the default).

Even more curiously, DerbyDialect overrides getIdentityColumnString() from the Db2 dialect by using "generated ALWAYS as identity" instead of "generated BY DEFAULT as identity". Derby however fully supports "by default" in identities as clarified in http://db.apache.org/derby/docs/10.1/ref/rrefsqlj37836.html .
"by default" should be preferred since it allows a direct insertion when needed (and I can't see no reason why enabling it for db2 and not for derby).

The patch attached simply deletes two methods, so that the default implementation from Db2Dialect is used:
- removing getIdentityColumnString() make derby use "by default" identities like db2 already does
- removing getNativeIdentifierGeneratorClass() make it choose IdentityGenerator.class (it falls back to the default strategy used in org.hibernate.dialect.Dialect)

note that part of this issue has already been reported in HHH-1918 (not addressing the identity generation string)


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