empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From doeb...@apache.org
Subject svn commit: r1150177 - in /incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db: DBDDLGenerator.java mysql/DBDatabaseDriverMySQL.java oracle/OracleDDLGenerator.java
Date Sat, 23 Jul 2011 17:41:31 GMT
Author: doebele
Date: Sat Jul 23 17:41:30 2011
New Revision: 1150177

URL: http://svn.apache.org/viewvc?rev=1150177&view=rev
Log:
EMPIREDB-103 first attempt

Added:
    incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBDDLGenerator.java
  (with props)
    incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/oracle/OracleDDLGenerator.java
  (with props)
Modified:
    incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/mysql/DBDatabaseDriverMySQL.java

Added: incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBDDLGenerator.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBDDLGenerator.java?rev=1150177&view=auto
==============================================================================
--- incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBDDLGenerator.java
(added)
+++ incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBDDLGenerator.java
Sat Jul 23 17:41:30 2011
@@ -0,0 +1,486 @@
+/*
+ * ESTEAM Software GmbH, 23.07.2011
+ */
+package org.apache.empire.db;
+
+import java.util.Iterator;
+
+import org.apache.empire.data.DataType;
+import org.apache.empire.exceptions.InvalidArgumentException;
+import org.apache.empire.exceptions.MiscellaneousErrorException;
+import org.apache.empire.exceptions.NotImplementedException;
+import org.apache.empire.exceptions.NotSupportedException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public abstract class DBDDLGenerator<T extends DBDatabaseDriver>
+{
+    // Logger
+    private static final Logger log = LoggerFactory.getLogger(DBDDLGenerator.class);
+    
+    protected T driver;
+    
+    protected DBDDLGenerator(T driver)
+    {
+        this.driver = driver;
+    }
+    
+
+    // Add statements
+    protected void addCreateTableStmt(DBTable table, StringBuilder sql, DBSQLScript script)
+    {
+        log.info("Adding create statmement for table {}.", table.getName());
+        script.addStmt(sql);
+    }
+    protected void addCreateIndexStmt(DBIndex index, StringBuilder sql, DBSQLScript script)
+    {
+        log.info("Adding create statmement for index {}.", index.getName());
+        script.addStmt(sql);
+    }
+    protected void addCreateRelationStmt(DBRelation rel, StringBuilder sql, DBSQLScript script)
+    {
+        log.info("Adding create statmement for relation {}.", rel.getName());
+        script.addStmt(sql);
+    }
+    protected void addCreateViewStmt(DBView v, StringBuilder sql, DBSQLScript script)
+    {
+        log.info("Adding create statmement for view {}.", v.getName());
+        script.addStmt(sql);
+    }
+    protected void addAlterTableStmt(DBColumn col, StringBuilder sql, DBSQLScript script)
+    {
+        log.info("Adding alter statmement for column {}.", col.getFullName());
+        script.addStmt(sql);
+    }
+
+    
+    /**
+     * appends the data type of a column
+     * @param c
+     * @param size
+     * @param sql
+     */
+    protected void appendColumnDataType(DataType c, double size, StringBuilder sql)
+    {
+        switch (c)
+        {
+            case INTEGER:
+                sql.append("INTEGER");
+                break;
+            case AUTOINC:
+                sql.append("INTEGER");
+                break;
+            case TEXT:
+            { // Check fixed or variable length
+                int len = Math.abs((int)size);
+                if (len == 0)
+                    len = 100;
+                sql.append("VARCHAR(");
+                sql.append(String.valueOf(len));
+                sql.append(")");
+            }
+                break;
+            case CHAR:
+            { // Check fixed or variable length
+                int len = Math.abs((int)size);
+                if (len == 0)
+                    len = 1;
+                sql.append("CHAR(");
+                sql.append(String.valueOf(size));
+                sql.append(")");
+            }
+                break;
+            case DATE:
+                sql.append("DATE");
+                break;
+            case DATETIME:
+                sql.append("DATETIME");
+                break;
+            case BOOL:
+                sql.append("BOOLEAN");
+                break;
+            case DOUBLE:
+                sql.append("DOUBLE");
+                break;
+            case DECIMAL:
+            {
+                sql.append("NUMBER(");
+                int prec = (int) size;
+                int scale = (int) ((size - prec) * 10 + 0.5);
+                // sql.append((prec+scale).ToString());sql.append(",");
+                sql.append(String.valueOf(prec));
+                sql.append(",");
+                sql.append(String.valueOf(scale));
+                sql.append(")");
+            }
+                break;
+            case CLOB:
+                sql.append("CLOB");
+                break;
+            case BLOB:
+                sql.append("BLOB");
+                if (size > 0)
+                    sql.append(" (" + ((long)size) + ") ");
+                break;
+            case UNIQUEID:
+                // emulate using java.util.UUID
+                sql.append("CHAR(36)");
+                break;
+            default:
+                // Error: Unable to append column of type UNKNOWN
+                throw new MiscellaneousErrorException("Error: Unable to append column of
type UNKNOWN");
+        }
+    }
+    
+    /**
+     * Appends a table column definition to a ddl statement
+     * @param c the column which description to append
+     * @param sql the sql builder object
+     * @return true if the column was successfully appended or false otherwise
+     */
+    protected void appendColumnDesc(DBTableColumn c, StringBuilder sql)
+    {
+        // Append name
+        c.addSQL(sql, DBExpr.CTX_NAME);
+        sql.append(" ");
+        // Unknown data type
+        appendColumnDataType(c.getDataType(), c.getSize(), sql);
+        // Default Value
+        if (driver.isDDLColumnDefaults() && !c.isAutoGenerated() && c.getDefaultValue()!=null)
+        {   sql.append(" DEFAULT ");
+            sql.append(driver.getValueString(c.getDefaultValue(), c.getDataType()));
+        }
+        // Nullable
+        if (c.isRequired() ||  c.isAutoGenerated())
+            sql.append(" NOT NULL");
+    }
+    
+    // GetDDL
+    public void getDDLScript(DBCmdType type, DBObject dbo, DBSQLScript script)
+    {
+        // The Object's database must be attached to this driver
+        if (dbo==null || dbo.getDatabase().getDriver()!=driver)
+            throw new InvalidArgumentException("dbo", dbo);
+        // Check Type of object
+        if (dbo instanceof DBDatabase)
+        { // Database
+            switch (type)
+            {
+                case CREATE:
+                    createDatabase((DBDatabase) dbo, script);
+                    return;
+                case DROP:
+                    dropObject(((DBDatabase) dbo).getSchema(), "USER", script);
+                    return;
+                default:
+                    throw new NotImplementedException(this, "getDDLScript." + dbo.getClass().getName()
+ "." + type);
+            }
+        } 
+        else if (dbo instanceof DBTable)
+        { // Table
+            switch (type)
+            {
+                case CREATE:
+                    createTable((DBTable) dbo, script);
+                    return;
+                case DROP:
+                    dropObject(((DBTable) dbo).getName(), "TABLE", script);
+                    return;
+                default:
+                    throw new NotImplementedException(this, "getDDLScript." + dbo.getClass().getName()
+ "." + type);
+            }
+        } 
+        else if (dbo instanceof DBView)
+        { // View
+            switch (type)
+            {
+                case CREATE:
+                    createView((DBView) dbo, script);
+                    return;
+                case DROP:
+                    dropObject(((DBView) dbo).getName(), "VIEW", script);
+                    return;
+                default:
+                    throw new NotImplementedException(this, "getDDLScript." + dbo.getClass().getName()
+ "." + type);
+            }
+        } 
+        else if (dbo instanceof DBRelation)
+        { // Relation
+            switch (type)
+            {
+                case CREATE:
+                    createRelation((DBRelation) dbo, script);
+                    return;
+                case DROP:
+                    dropObject(((DBRelation) dbo).getName(), "CONSTRAINT", script);
+                    return;
+                default:
+                    throw new NotImplementedException(this, "getDDLScript." + dbo.getClass().getName()
+ "." + type);
+            }
+        } 
+        else if (dbo instanceof DBTableColumn)
+        { // Table Column
+            alterTable((DBTableColumn) dbo, type, script);
+            return;
+        } 
+        else
+        { // dll generation not supported for this type
+            throw new NotSupportedException(this, "getDDLScript() for "+dbo.getClass().getName());
+        }
+    }
+
+    /**
+     * Returns true if the database has been created successfully.
+     * 
+     * @return true if the database has been created successfully
+     */
+    protected void createDatabase(DBDatabase db, DBSQLScript script)
+    {
+        // Create all Tables
+        Iterator<DBTable> tables = db.getTables().iterator();
+        while (tables.hasNext())
+        {
+            createTable(tables.next(), script);
+        }
+        // Create Relations
+        Iterator<DBRelation> relations = db.getRelations().iterator();
+        while (relations.hasNext())
+        {
+            createRelation(relations.next(), script);
+        }
+        // Create Views
+        Iterator<DBView> views = db.getViews().iterator();
+        while (views.hasNext())
+        {
+            try {
+                createView(views.next(), script);
+            } catch(NotImplementedException e) {
+                // View command not implemented
+                log.warn("Error creating the view {0}. This view will be ignored.");
+                continue;
+            }
+        }
+    }
+    
+    /**
+     * Returns true if the table has been created successfully.
+     * @return true if the table has been created successfully
+     */
+    protected void createTable(DBTable t, DBSQLScript script)
+    {
+        StringBuilder sql = new StringBuilder();
+        sql.append("-- creating table ");
+        sql.append(t.getName());
+        sql.append(" --\r\n");
+        sql.append("CREATE TABLE ");
+        t.addSQL(sql, DBExpr.CTX_FULLNAME);
+        sql.append(" (");
+        boolean addSeparator = false;
+        Iterator<DBColumn> columns = t.getColumns().iterator();
+        while (columns.hasNext())
+        {
+            DBTableColumn c = (DBTableColumn) columns.next();
+            if (c.getDataType()==DataType.UNKNOWN)
+                continue; // Ignore and continue;
+            // Append column
+            sql.append((addSeparator) ? ",\r\n   " : "\r\n   ");
+            appendColumnDesc(c, sql);
+            addSeparator = true;
+        }
+        // Primary Key
+        DBIndex pk = t.getPrimaryKey();
+        if (pk != null)
+        { // add the primary key
+            sql.append(",\r\n CONSTRAINT ");
+            appendElementName(sql, pk.getName());
+            sql.append(" PRIMARY KEY (");
+            addSeparator = false;
+            // columns
+            DBColumn[] keyColumns = pk.getColumns();
+            for (int i = 0; i < keyColumns.length; i++)
+            {
+                sql.append((addSeparator) ? ", " : "");
+                keyColumns[i].addSQL(sql, DBExpr.CTX_NAME);
+                addSeparator = true;
+            }
+            sql.append(")");
+        }
+        sql.append(")");
+        // Create the table
+        addCreateTableStmt(t, sql, script);
+        // Create other Indexes (except primary key)
+        Iterator<DBIndex> indexes = t.getIndexes().iterator();
+        while (indexes.hasNext())
+        {
+            DBIndex idx = indexes.next();
+            if (idx == pk || idx.getType() == DBIndex.PRIMARYKEY)
+                continue;
+
+            // Create Index
+            sql.setLength(0);
+            sql.append((idx.getType() == DBIndex.UNIQUE) ? "CREATE UNIQUE INDEX " : "CREATE
INDEX ");
+            appendElementName(sql, idx.getName());
+            sql.append(" ON ");
+            t.addSQL(sql, DBExpr.CTX_FULLNAME);
+            sql.append(" (");
+            addSeparator = false;
+
+            // columns
+            DBColumn[] idxColumns = idx.getColumns();
+            for (int i = 0; i < idxColumns.length; i++)
+            {
+                sql.append((addSeparator) ? ", " : "");
+                idxColumns[i].addSQL(sql, DBExpr.CTX_NAME);
+                sql.append("");
+                addSeparator = true;
+            }
+            sql.append(")");
+            // Create Index
+            addCreateIndexStmt(idx, sql, script);
+        }
+    }
+
+    /**
+     * Creates a sql string for creating a relation and appends it to the supplied buffer
+     * @return true if the relation has been created successfully
+     */
+    protected void createRelation(DBRelation r, DBSQLScript script)
+    {
+        DBTable sourceTable = (DBTable) r.getReferences()[0].getSourceColumn().getRowSet();
+        DBTable targetTable = (DBTable) r.getReferences()[0].getTargetColumn().getRowSet();
+
+        StringBuilder sql = new StringBuilder();
+        sql.append("-- creating foreign key constraint ");
+        sql.append(r.getName());
+        sql.append(" --\r\n");
+        sql.append("ALTER TABLE ");
+        sourceTable.addSQL(sql, DBExpr.CTX_FULLNAME);
+        sql.append(" ADD CONSTRAINT ");
+        appendElementName(sql, r.getName());
+        sql.append(" FOREIGN KEY (");
+        // Source Names
+        boolean addSeparator = false;
+        DBRelation.DBReference[] refs = r.getReferences();
+        for (int i = 0; i < refs.length; i++)
+        {
+            sql.append((addSeparator) ? ", " : "");
+            refs[i].getSourceColumn().addSQL(sql, DBExpr.CTX_NAME);
+            addSeparator = true;
+        }
+        // References
+        sql.append(") REFERENCES ");
+        targetTable.addSQL(sql, DBExpr.CTX_FULLNAME);
+        sql.append(" (");
+        // Target Names
+        addSeparator = false;
+        for (int i = 0; i < refs.length; i++)
+        {
+            sql.append((addSeparator) ? ", " : "");
+            refs[i].getTargetColumn().addSQL(sql, DBExpr.CTX_NAME);
+            addSeparator = true;
+        }
+        // done
+        sql.append(")");
+        // done
+        addCreateRelationStmt(r, sql, script);
+    }
+
+    /**
+     * Creates an alter table dll statement for adding, modifying or dropping a column.
+     * @param col the column which to add, modify or drop
+     * @param type the type of operation to perform
+     * @param script to which to append the sql statement to
+     * @return true if the statement was successfully appended to the buffer
+     */
+    protected void alterTable(DBTableColumn col, DBCmdType type, DBSQLScript script)
+    {
+        StringBuilder sql = new StringBuilder();
+        sql.append("ALTER TABLE ");
+        col.getRowSet().addSQL(sql, DBExpr.CTX_FULLNAME);
+        switch(type)
+        {
+            case CREATE:
+                sql.append(" ADD ");
+                appendColumnDesc(col, sql);
+                break;
+            case ALTER:
+                sql.append(" MODIFY ");
+                appendColumnDesc(col, sql);
+                break;
+            case DROP:
+                sql.append(" DROP COLUMN ");
+                sql.append(col.getName());
+                break;
+        }
+        // done
+        addAlterTableStmt(col, sql, script);
+    }
+    
+    /**
+     * Returns true if the view has been created successfully.
+     * 
+     * @return true if the view has been created successfully
+     */
+    protected void createView(DBView v, DBSQLScript script)
+    {
+        // Create the Command
+        DBCommandExpr cmd = v.createCommand();
+        if (cmd==null)
+        {   // Check whether Error information is available
+            log.error("No command has been supplied for view " + v.getName());
+            throw new NotImplementedException(this, v.getName() + ".createCommand");
+        }
+        // Make sure there is no OrderBy
+        cmd.clearOrderBy();
+
+        // Build String
+        StringBuilder sql = new StringBuilder();
+        sql.append( "CREATE OR REPLACE VIEW ");
+        v.addSQL(sql, DBExpr.CTX_FULLNAME);
+        sql.append( " (" );
+        boolean addSeparator = false;
+        for(DBColumn c : v.getColumns())
+        {
+            if (addSeparator)
+                sql.append(", ");
+            // Add Column name
+            c.addSQL(sql, DBExpr.CTX_NAME);
+            // next
+            addSeparator = true;
+        }
+        sql.append(")\r\nAS\r\n");
+        cmd.addSQL( sql, DBExpr.CTX_DEFAULT);
+        // done
+        addCreateViewStmt(v, sql, script);
+    }
+    
+    /**
+     * Returns true if the object has been dropped successfully.
+     * 
+     * @return true if the object has been dropped successfully
+     */
+    protected void dropObject(String name, String objType, DBSQLScript script)
+    {
+        if (name == null || name.length() == 0)
+            throw new InvalidArgumentException("name", name);
+        // Create Drop Statement
+        StringBuilder sql = new StringBuilder();
+        sql.append("DROP ");
+        sql.append(objType);
+        sql.append(" ");
+        appendElementName(sql, name);
+        script.addStmt(sql);
+    }
+    
+    // Internal helpers 
+    protected boolean detectQuoteName(String name)
+    {
+        return driver.detectQuoteName(name);
+    }
+
+    protected void appendElementName(StringBuilder sql, String name)
+    {
+        driver.appendElementName(sql, name);
+    }
+
+}

Propchange: incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBDDLGenerator.java
------------------------------------------------------------------------------
    eol-style = native

Propchange: incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/DBDDLGenerator.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/mysql/DBDatabaseDriverMySQL.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/mysql/DBDatabaseDriverMySQL.java?rev=1150177&r1=1150176&r2=1150177&view=diff
==============================================================================
--- incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/mysql/DBDatabaseDriverMySQL.java
(original)
+++ incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/mysql/DBDatabaseDriverMySQL.java
Sat Jul 23 17:41:30 2011
@@ -163,7 +163,7 @@ public class DBDatabaseDriverMySQL exten
     }
     
     /**
-     * returns whether a sequence table is used for record identiy management.<br>
+     * returns whether a sequence table is used for record identity 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.
      */
@@ -174,7 +174,7 @@ public class DBDatabaseDriverMySQL exten
 
     /**
      * If set to true a special table is used for sequence number generation.<br>
-     * Otherwise the AutoIncrement feature of MySQL is used identiy fields. 
+     * Otherwise the AutoIncrement feature of MySQL is used identity fields. 
      * @param useSequenceTable true to use a sequence table or false otherwise.
      */
     public void setUseSequenceTable(boolean useSequenceTable)

Added: incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/oracle/OracleDDLGenerator.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/oracle/OracleDDLGenerator.java?rev=1150177&view=auto
==============================================================================
--- incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/oracle/OracleDDLGenerator.java
(added)
+++ incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/oracle/OracleDDLGenerator.java
Sat Jul 23 17:41:30 2011
@@ -0,0 +1,142 @@
+/*
+ * ESTEAM Software GmbH, 23.07.2011
+ */
+package org.apache.empire.db.oracle;
+
+import java.util.Iterator;
+
+import org.apache.empire.data.DataType;
+import org.apache.empire.db.DBColumn;
+import org.apache.empire.db.DBDDLGenerator;
+import org.apache.empire.db.DBDatabase;
+import org.apache.empire.db.DBExpr;
+import org.apache.empire.db.DBSQLScript;
+import org.apache.empire.db.DBTable;
+import org.apache.empire.db.DBTableColumn;
+import org.apache.empire.db.oracle.DBDatabaseDriverOracle.BooleanType;
+
+public class OracleDDLGenerator extends DBDDLGenerator<DBDatabaseDriverOracle>
+{
+    public OracleDDLGenerator(DBDatabaseDriverOracle driver)
+    {
+        super(driver);
+    }
+
+    @Override
+    protected void appendColumnDataType(DataType c, double size, StringBuilder sql)
+    {
+        switch (c)
+        {
+            case TEXT:
+            { // Check fixed or variable length
+                int len = Math.abs((int)size);
+                if (len == 0)
+                    len = 100;
+                sql.append("VARCHAR2(");
+                sql.append(String.valueOf(len));
+                sql.append(" char)");
+            }
+                break;
+            case BOOL:
+                if ( driver.getBooleanType() == BooleanType.CHAR )
+                     sql.append("CHAR(1)");
+                else sql.append("NUMBER(1,0)");
+                break;
+            case DOUBLE:
+                sql.append("FLOAT(80)");
+                break;
+                
+            default:
+                // use default
+                super.appendColumnDataType(c, size, sql);
+        }
+    }
+ 
+    @Override
+    protected void createDatabase(DBDatabase db, DBSQLScript script)
+    {
+        // Create all Sequences
+        Iterator<DBTable> seqtabs = db.getTables().iterator();
+        while (seqtabs.hasNext())
+        {
+            DBTable table = seqtabs.next();
+            Iterator<DBColumn> cols = table.getColumns().iterator();
+            while (cols.hasNext())
+            {
+                DBTableColumn c = (DBTableColumn) cols.next();
+                if (c.getDataType() == DataType.AUTOINC)
+                {
+                    createSequence(db, c, script);
+                }
+            }
+        }
+        // Tables and the rest
+        super.createDatabase(db, script);
+    }
+    
+    /**
+     * Returns true if the sequence has been created successfully.
+     * 
+     * @return true if the sequence has been created successfully
+     */
+    protected void createSequence(DBDatabase db, DBTableColumn c, DBSQLScript script)
+    {
+        Object defValue = c.getDefaultValue();
+        String seqName = (defValue != null) ? defValue.toString() : c.toString();
+        // createSQL
+        StringBuilder sql = new StringBuilder();
+        sql.append("-- creating sequence for column ");
+        sql.append(c.getFullName());
+        sql.append(" --\r\n");
+        sql.append("CREATE SEQUENCE ");
+        db.appendQualifiedName(sql, seqName, detectQuoteName(seqName));
+        sql.append(" INCREMENT BY 1 START WITH 1 MINVALUE 0 NOCYCLE NOCACHE NOORDER");
+        // executeDLL
+        script.addStmt(sql);
+    }
+
+    @Override
+    protected void createTable(DBTable t, DBSQLScript script)
+    {
+        super.createTable(t, script);
+        // Add Column comments (if any)
+        DBDatabase db = t.getDatabase();
+        createComment(db, "TABLE", t, t.getComment(), script);
+        Iterator<DBColumn> columns = t.getColumns().iterator();
+        while (columns.hasNext())
+        {
+            DBColumn c = columns.next();
+            String com = c.getComment();
+            if (com != null)
+                createComment(db, "COLUMN", c, com, script);
+        }
+    }
+    
+    /**
+     * Returns true if the comment has been created successfully.
+     * 
+     * @return true if the comment has been created successfully
+     */
+    protected void createComment(DBDatabase db, String type, DBExpr expr, String comment,
DBSQLScript script)
+    {
+        if (comment==null || comment.length()==0)
+            return; // Nothing to do
+        StringBuilder sql = new StringBuilder();
+        sql.append("COMMENT ON ");
+        sql.append(type);
+        sql.append(" ");
+        if (expr instanceof DBColumn)
+        {
+            DBColumn c = (DBColumn)expr;
+            c.getRowSet().addSQL(sql, DBExpr.CTX_NAME);
+            sql.append(".");
+        }
+        expr.addSQL(sql, DBExpr.CTX_NAME);
+        sql.append(" IS '");
+        sql.append(comment);
+        sql.append("'");
+        // Create Index
+        script.addStmt(sql);
+    }
+    
+}

Propchange: incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/oracle/OracleDDLGenerator.java
------------------------------------------------------------------------------
    eol-style = native

Propchange: incubator/empire-db/branches/EMPIREDB-99/empire-db/src/main/java/org/apache/empire/db/oracle/OracleDDLGenerator.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message