db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r418845 - in /db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/mssql: MSSqlBuilder.java MSSqlModelReader.java
Date Mon, 03 Jul 2006 20:49:09 GMT
Author: tomdz
Date: Mon Jul  3 13:49:09 2006
New Revision: 418845

URL: http://svn.apache.org/viewvc?rev=418845&view=rev
Log:
Fixes/enhancements to the SQL Server platform

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

Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/mssql/MSSqlBuilder.java
URL: http://svn.apache.org/viewvc/db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/mssql/MSSqlBuilder.java?rev=418845&r1=418844&r2=418845&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/mssql/MSSqlBuilder.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/mssql/MSSqlBuilder.java Mon Jul
 3 13:49:09 2006
@@ -221,6 +221,14 @@
     /**
      * {@inheritDoc}
      */
+    public String getSelectLastIdentityValues(Table table)
+    {
+        return "SELECT @@IDENTITY";
+    }
+
+    /**
+     * {@inheritDoc}
+     */
     public String getDeleteSql(Table table, Map pkValues, boolean genPlaceholders)
     {
         return getQuotationOnStatement() + super.getDeleteSql(table, pkValues, genPlaceholders);

Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/mssql/MSSqlModelReader.java
URL: http://svn.apache.org/viewvc/db/ddlutils/trunk/src/java/org/apache/ddlutils/platform/mssql/MSSqlModelReader.java?rev=418845&r1=418844&r2=418845&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 Mon
Jul  3 13:49:09 2006
@@ -29,6 +29,7 @@
 import org.apache.ddlutils.model.Column;
 import org.apache.ddlutils.model.Index;
 import org.apache.ddlutils.model.Table;
+import org.apache.ddlutils.model.TypeMap;
 import org.apache.ddlutils.platform.DatabaseMetaDataWrapper;
 import org.apache.ddlutils.platform.JdbcModelReader;
 import org.apache.oro.text.regex.MalformedPatternException;
@@ -211,6 +212,11 @@
 					defaultValue = defaultValue.substring(0, defaultValue.length() - 1);
 				}
 			}
+            else if (TypeMap.isTextType(column.getTypeCode()))
+            {
+                defaultValue = unescape(defaultValue, "'", "''");
+            }
+            
 			column.setDefaultValue(defaultValue);
 		}
 		if ((column.getTypeCode() == Types.DECIMAL) && (column.getSizeAsInt() == 19) &&
(column.getScale() == 0))



Mime
View raw message