db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r377158 - /db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/mssql/MSSqlModelReader.java
Date Sun, 12 Feb 2006 11:24:10 GMT
Author: tomdz
Date: Sun Feb 12 03:24:07 2006
New Revision: 377158

URL: http://svn.apache.org/viewcvs?rev=377158&view=rev
Log:
Replaced StringBuilder with StringBuffer

Modified:
    db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/mssql/MSSqlModelReader.java

Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/mssql/MSSqlModelReader.java
URL: http://svn.apache.org/viewcvs/db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/mssql/MSSqlModelReader.java?rev=377158&r1=377157&r2=377158&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/mssql/MSSqlModelReader.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/mssql/MSSqlModelReader.java Sun
Feb 12 03:24:07 2006
@@ -94,8 +94,8 @@
 	protected boolean isInternalPrimaryKeyIndex(Table table, Index index)
 	{
 		// Sql Server generates an index "PK__[table name]__[hex number]"
-		StringBuilder pkIndexName = new StringBuilder();
-		Column[]      pks         = table.getPrimaryKeyColumns();
+		StringBuffer pkIndexName = new StringBuffer();
+		Column[]     pks         = table.getPrimaryKeyColumns();
 
 		if (pks.length > 0)
 		{
@@ -153,6 +153,15 @@
 				if (timestamp != null)
 				{
 					defaultValue = timestamp.toString();
+				}
+			}
+			else if (column.getTypeCode() == Types.DECIMAL)
+			{
+				// For some reason, Sql Server 2005 always returns DECIMAL default values with a dot
+				// even if the scale is 0, so we remove the dot
+				if ((column.getScale() == 0) && defaultValue.endsWith("."))
+				{
+					defaultValue = defaultValue.substring(0, defaultValue.length() - 1);
 				}
 			}
 			column.setDefaultValue(defaultValue);



Mime
View raw message