[hibernate-commits] Hibernate SVN: r18244 - core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/mapping.

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Wed Dec 16 13:26:37 EST 2009


Author: stliu
Date: 2009-12-16 13:26:37 -0500 (Wed, 16 Dec 2009)
New Revision: 18244

Modified:
   core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/mapping/Table.java
Log:
JBPAPP-2943 HHH-4457 - SchemaUpdate fails on Sybase ASE 15 when a new column is added without a default value

Modified: core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/mapping/Table.java
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/mapping/Table.java	2009-12-16 18:23:31 UTC (rev 18243)
+++ core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/mapping/Table.java	2009-12-16 18:26:37 UTC (rev 18244)
@@ -295,16 +295,15 @@
 				String defaultValue = column.getDefaultValue();
 				if ( defaultValue != null ) {
 					alter.append( " default " ).append( defaultValue );
-
-					if ( column.isNullable() ) {
-						alter.append( dialect.getNullColumnString() );
-					}
-					else {
-						alter.append( " not null" );
-					}
-
 				}
-
+				
+				if ( column.isNullable() ) {
+					alter.append( dialect.getNullColumnString() );
+				}
+				else {
+					alter.append( " not null" );
+				}
+				
 				boolean useUniqueConstraint = column.isUnique() &&
 						dialect.supportsUnique() &&
 						( !column.isNullable() || dialect.supportsNotNullUnique() );



More information about the hibernate-commits mailing list