[hibernate-dev] TableGenerator missing "not null"
jcosta at redhat.com
Fri Dec 12 08:47:34 EST 2008
As suggested in a previous topic, I'll pay a genuine Czech beer in any pub in Brno for whoever reviews the patch in HHH-3650 (or Moravian wine, if you prefer) :-)
The class org.hibernate.id.enhanced.TableGenerator is used to generate tables which acts as sequences. In the method sqlCreateStrings(), it builds a create-table statement, but the primary key column specified by the property "segmentColumnName" is not being marked as "not-null", causing DB2 (and probably others) to throw an exception. So, the patch adds a "not null" in the statement, but I'm wondering if I should get the "not null" string from somewhere else. I suspected that Dialect would have it, but only have for "nullable" columns. I believe that "not null" is quite standard, and doesn't requires the abstraction, but maybe you have another idea :-)
More information about the hibernate-dev