EntityModeler - ERPrototypes - Oracle - generated code doesn't handle CLOB column

From: Mark Ritchie (mark.ritchi..ac.com)
Date: Wed Feb 17 2010 - 18:47:32 EST

  • Next message: Mike Schrag: "Re: EntityModeler - ERPrototypes - Oracle - generated code doesn't handle CLOB column"

    Hi Everyone!

    My EOModel is using ERPrototypes with EOJDBCOraclePrototypes selected.
    I have a column set to varcharLarge and when I generate the migration I get:
            ...
            personTable.newStringColumn("longName", false);
            ...

    That statement results in SQL which is invalid in Oracle:
    (varchar2 with column width 10000000 which is somewhat beyond the 4000 limit.)

    I think that it code should be something like:
            ...
            personTable.newClobColumn("longName", false);
            ...

    which defines column as CLOB. I propose:
    Marks-MacBook:woproject mark$ svn diff wolips/core/plugins/org.objectstyle.wolips.eomodeler.core/templates/EntityMigration0.java
    Index: wolips/core/plugins/org.objectstyle.wolips.eomodeler.core/templates/EntityMigration0.java
    ===================================================================
    --- wolips/core/plugins/org.objectstyle.wolips.eomodeler.core/templates/EntityMigration0.java (revision 6031)
    +++ wolips/core/plugins/org.objectstyle.wolips.eomodeler.core/templates/EntityMigration0.java (working copy)
    ..-8,6 +8,8 @@
     #if ($attribute.sqlGenerationCreateProperty)
     #if ($attribute.prototype.name == "longText")
                     ${migrationTableName}.newLargeStringColumn("${attribute.columnName}", ${attribute.sqlGenerationAllowsNull});
    +#elseif ($attribute.javaClassName == "String" && $attribute.externalType == "CLOB")
    + ${migrationTableName}.newClobColumn("${attribute.columnName}", ${attribute.sqlGenerationAllowsNull});
     #elseif ($attribute.javaClassName == "String" && $attribute.width)
                     ${migrationTableName}.newStringColumn("${attribute.columnName}", ${attribute.width}, ${attribute.sqlGenerationAllowsNull});
     #elseif ($attribute.javaClassName == "String")

    I've looked about the other prototypes and it seems that CLOB isn't used very often so I think that this will have minimal impact but I wanted to check with the community before I submitted the patch. What do folks think?

    Thanks!
    Mark



    This archive was generated by hypermail 2.0.0 : Wed Feb 17 2010 - 18:48:18 EST