-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Shouldn't the enhanced TableGenerator behave like ...
PostPosted: Tue Apr 22, 2008 5:23 pm 
Newbie

Joined: Mon Apr 21, 2008 4:38 pm
Posts: 7
Hibernate version: 3.2.6

MySQL: 5.0.4

I was under the impression that the enhanced TableGenerator would behave like the older MultipleHiLoPerTableGenerator in that a new row would be inserted in the "hibernate_sequences" for each and every entity. I am seeing a different behavior in that there is one and only one "default" row.

I should state that my entities extend a BaseEntity and that the id column is defined within. i.e.

Code:
@Id
@GeneratedValue(generator="hibseq")
@GenericGenerator(name="hibseq", strategy="org.hibernate.id.enhanced.TableGenerator",
        parameters = {
            @Parameter(name="initial_value", value = "1000"),
            @Parameter(name="table_name", value = "hibernate_sequences")
        }
    )
private Long id;


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 23, 2008 12:13 pm 
Newbie

Joined: Mon Apr 21, 2008 4:38 pm
Posts: 7
Another way of asking this question is why does the new enhanced TableGenerator use a different approach for building the query, update, and insert statements than the MultipleHiLoPerTableGenerator class in which it is based (albeit loosely). In particular, the where clause differs ...

enhanced TableGenerator uses a configured segment_value while the MultipleHiLoPerTableGenerator uses a key value (which is based upon the entity name). Since all my entities extend an abstract BaseEntity, I want to use the enhanced TableGenerator with the old behavior for building the where clause.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.