HHH-6775: Changed AbstractTransactSQLDialect.getNullColumnString() to return empty string, which matches some of the other dialects and allows the DB to auto-determine a column's nullability in certain situations

This commit is contained in:
John Verhaeg 2011-10-26 14:14:30 -05:00
parent cbbc786f18
commit d4b47e78ba
4 changed files with 6 additions and 6 deletions

View File

@ -129,7 +129,7 @@ abstract class AbstractTransactSQLDialect extends Dialect {
return "add";
}
public String getNullColumnString() {
return " null";
return "";
}
public boolean qualifyIndexName() {
return false;

View File

@ -42,11 +42,11 @@ public class JoinColumnOverrideTest extends BaseUnitTestCase {
log.debug(s);
}
String expectedSqlPointyTooth = "create table PointyTooth (id numeric(128,0) not null, " +
"bunny_id numeric(128,0) null, primary key (id))";
"bunny_id numeric(128,0), primary key (id))";
assertEquals("Wrong SQL", expectedSqlPointyTooth, schema[1]);
String expectedSqlTwinkleToes = "create table TwinkleToes (id numeric(128,0) not null, " +
"bunny_id numeric(128,0) null, primary key (id))";
"bunny_id numeric(128,0), primary key (id))";
assertEquals("Wrong SQL", expectedSqlTwinkleToes, schema[2]);
}
catch (Exception e) {

View File

@ -65,11 +65,11 @@ public class JoinColumnOverrideTest extends BaseUnitTestCase {
log.debug(s);
}
String expectedSqlPointyTooth = "create table PointyTooth (id numeric(128,0) not null, " +
"bunny_id numeric(128,0) null, primary key (id))";
"bunny_id numeric(128,0), primary key (id))";
assertEquals("Wrong SQL", expectedSqlPointyTooth, schema[1]);
String expectedSqlTwinkleToes = "create table TwinkleToes (id numeric(128,0) not null, " +
"bunny_id numeric(128,0) null, primary key (id))";
"bunny_id numeric(128,0), primary key (id))";
assertEquals("Wrong SQL", expectedSqlTwinkleToes, schema[2]);
}
catch (Exception e) {

View File

@ -34,7 +34,7 @@ public class NullablePrimaryKeyTest {
for (String s : schema) {
log.debug(s);
}
String expectedMappingTableSql = "create table personAddress (address_id numeric(19,0) null, " +
String expectedMappingTableSql = "create table personAddress (address_id numeric(19,0), " +
"person_id numeric(19,0) not null, primary key (person_id))";
Assert.assertEquals( "Wrong SQL", expectedMappingTableSql, schema[2] );
} catch (Exception e) {