Hmm.... varcharLarge is a weird one. It seems like maybe it should be calling
newLargeStringColumn and that migration for Oracle should use a CLOB. It seems
weird that Oracle's definition for longText is BLOB and not CLOB, too. The
relationship between longText and varcharLarge is unclear to me. I always use
varcharLarge, but I never noticed that it wasn't calling newLargeStringColumn.
On Feb 17, 2010, at 6:47 PM, Mark Ritchie wrote:
> 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
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]