empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From doeb...@apache.org
Subject svn commit: r919438 - /incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/mysql/DBDatabaseDriverMySQL.java
Date Fri, 05 Mar 2010 15:02:27 GMT
Author: doebele
Date: Fri Mar  5 15:02:27 2010
New Revision: 919438

URL: http://svn.apache.org/viewvc?rev=919438&view=rev
Log:
EMPIREDB-67

Modified:
    incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/mysql/DBDatabaseDriverMySQL.java

Modified: incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/mysql/DBDatabaseDriverMySQL.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/mysql/DBDatabaseDriverMySQL.java?rev=919438&r1=919437&r2=919438&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/mysql/DBDatabaseDriverMySQL.java
(original)
+++ incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/mysql/DBDatabaseDriverMySQL.java
Fri Mar  5 15:02:27 2010
@@ -68,7 +68,8 @@
     // When set to 'false' (default) MySQL's autoincrement feature is used.
     private boolean useSequenceTable = false;
     private String sequenceTableName = "Sequences";
-    
+    private String engine; // The database engine to use when creating new tables
+
     /**
      * Constructor for the MySQL database driver.<br>
      */
@@ -98,6 +99,24 @@
     }
 
     /**
+     * Get the table engine that is used when creating new tables
+     * @return the table engine
+     */
+    public String getEngine()
+    {
+        return engine;
+    }
+
+    /**
+     * Set the table engine that is used when creating new tables
+     * @param engine the table engine
+     */
+    public void setEngine(String engine)
+    {
+        this.engine = engine;
+    }
+    
+    /**
      * returns whether a sequence table is used for record identiy management.<br>
      * Default is false. In this case the AutoIncrement feature of MySQL is used.
      * @return true if a sequence table is used instead of identity columns.
@@ -469,6 +488,12 @@
             sql.append(")");
         }
         sql.append(")");
+        // Engine
+        if (StringUtils.isValid(engine)) 
+        {   // Set the table engine
+            sql.append(" ENGINE = ");
+            sql.append(engine);
+        }
         // Comment?
         String comment = t.getComment();
         if (StringUtils.isValid(comment))



Mime
View raw message