[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-3454) Allow enhanced.TableGenerator to segment itself per entity as default

Drew Kutcharian (JIRA) noreply at atlassian.com
Fri Nov 14 12:11:16 EST 2008


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

Drew Kutcharian commented on HHH-3454:
--------------------------------------

Steve,

I'm sure Hibernate versions are correct since:

1) I use Ivy to download the correct versions of libraries from JBoss Maven repository

2) As a workaround I created my own custom id generator that extends TableGenerator (com.foo.bar.IDGenerator) and all it does is it overrides the configure method as:
        @Override
        public void configure(final Type type, final Properties params, final Dialect dialect) throws MappingException {
                params.put("optimizer", "pooled");
                params.put("initial_value", "1");
                params.put("increment_size", "10");
                params.put("prefer_entity_table_as_segment_value", "true");
                super.configure(type, params, dialect);
        }

and in my entity I have:

        @Id
        @GenericGenerator(name = "idGenerator", strategy = "com.foo.bar.IDGenerator")
        @GeneratedValue(generator = "idGenerator")
        @Column(name = "id")
        private Integer                         id                                      = null;

and things work per spec.

I was worried I wasn't using the annotations correctly that's why I commented to this JIRA in the first place. 

This is really strange.

cheers,

Drew


> Allow enhanced.TableGenerator to segment itself per entity as default
> ---------------------------------------------------------------------
>
>                 Key: HHH-3454
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3454
>             Project: Hibernate Core
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 3.3.0.SP1
>            Reporter: Steve Ebersole
>            Assignee: Steve Ebersole
>             Fix For: 3.2.x, 3.3.1, 3.4
>
>
> Currently TableGenerator use a static string ("default" ) for its default segment column name.  The implication is that all TableGenerators defined without specifying a segment value explicitly ended up using the same row.
> Where this cam up was in the case of annotations where the generator is attached to a base entity class.

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