<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16640" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=909213421-27042008><FONT face=Arial
color=#0000ff size=2>I apologize if this is a 2nd posting.
</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> hibernate-dev-bounces@lists.jboss.org
[mailto:hibernate-dev-bounces@lists.jboss.org] <B>On Behalf Of </B>Tom
Muldoon<BR><B>Sent:</B> Thursday, April 24, 2008 8:04 AM<BR><B>To:</B>
'hibernate-dev@lists.jboss.org'<BR><B>Subject:</B> [hibernate-dev] Shortcomings
in org.hibernate.id.enhanced.TableGenerator class<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr align=left><FONT face=Arial size=2><SPAN
class=655351611-24042008>I'm working with the
org.hibernate.id.enhanced.TableGenerator class and I've noticed a couple of
shortcomings (imho). First and foremost, it creates one row in the
hibernate_sequences table for each configured segment_value (as opposed to one
row for each "target_table" as implemented within the
MultipleHiLoPerTableGenerator). Given the fact that my id column is defined in
an abstract BaseEntity class, I can't use the enhanced TableGenerator class as
is (since one sequence for all of my entities is not viable for my application).
</SPAN></FONT><FONT face=Arial size=2><SPAN class=655351611-24042008>Which leads
me to my second point. All of the member variables are declared as private,
instead of protected, which makes extending the class for the purpose of
overriding the configure method impossible. </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=655351611-24042008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=655351611-24042008>For what it's worth,
here's the change that I had planned to make (in the configure method)
...</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=655351611-24042008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=655351611-24042008>Change the setting
of the segmentValue from ...</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=655351611-24042008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2>
segmentValue = params.getProperty( SEGMENT_VALUE_PARAM );<BR></FONT></DIV>
<DIV><FONT size=+0><SPAN class=655351611-24042008><FONT face=Arial size=2>...
to</FONT></SPAN></FONT></DIV>
<DIV><FONT size=+0><SPAN class=655351611-24042008><FONT face=Arial
size=2></FONT></SPAN></FONT> </DIV>
<DIV><FONT size=+0><SPAN class=655351611-24042008><FONT face=Arial
size=2> segmentValue =
params.getProperty(TABLE);</FONT></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><SPAN class=655351611-24042008><FONT face=Arial size=2>Of course, such a
change would change the class behavior significantly - using targetTable instead
of segmentValue as the variable name would probably make sense.
</FONT></SPAN></DIV>
<DIV><SPAN class=655351611-24042008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=655351611-24042008><FONT face=Arial size=2>So, with that said,
is another class worth-while (assuming that such a change to the existing class
would break backwards compatability)? </FONT></SPAN></DIV>
<DIV><SPAN class=655351611-24042008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=655351611-24042008><FONT face=Arial><FONT size=2>And, on a
related note, the enhanced TableGenerator is cluster safe, right?<SPAN
class=063450112-24042008><FONT
color=#0000ff> </FONT></SPAN></FONT></FONT></SPAN></DIV>
<DIV><SPAN class=655351611-24042008><FONT face=Arial><FONT size=2><SPAN
class=063450112-24042008></SPAN></FONT></FONT></SPAN> </DIV>
<DIV><SPAN class=655351611-24042008><FONT face=Arial><FONT size=2><SPAN
class=063450112-24042008>Thoughts? </SPAN></FONT></FONT></SPAN></DIV>
<DIV><SPAN class=655351611-24042008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=655351611-24042008><FONT face=Arial size=2>PS. I entered a jira
improvement yesterday - here's the link ...</FONT></SPAN></DIV>
<DIV><SPAN class=655351611-24042008><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=655351611-24042008><FONT face=Arial size=2><A
href="http://opensource.atlassian.com/projects/hibernate/browse/HHH-3249">http://opensource.atlassian.com/projects/hibernate/browse/HHH-3249</A></FONT></SPAN></DIV></BODY></HTML>