Re: CLOB and MySQL

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Fri Jan 28 2005 - 09:11:21 EST

  • Next message: Bryan Lewis: "Re: caching of query results"

    Todd,

    Many DBs call CLOB some other name. MySQL has a number of TEXT types
    (LONGTEXT, TEXT, etc...) for large char columns. DbAdapter maps types from
    JDBC standard (those that you select in the Modeler for DbAttributes) to
    DB native types using types.xml file located in each adapter package in
    cayenne.jar. MySQL adapter has this entry:

    <jdbc-type name="CLOB">
       <db-type name="LONGTEXT"/>
    </jdbc-type>

    So generated schema should already have LONGTEXT for all DataMap clobs if
    you use the right adapter. If you write schema generation script yourself,
    do something similar.

    Andrus

    > I just used a CLOB for the first time, and when I generated the SQL, I
    > discovered that MySQL doesn't have a CLOB.
    >
    > Does the generated SQL for to create the Database Schema pay any
    > attention to the JDBC driver, or is it meant to be generic?
    >
    > Is the fix simply to change the CLOB to TEXT in the .sql file I just
    > created?
    >
    > Thanks,
    > Todd



    This archive was generated by hypermail 2.0.0 : Fri Jan 28 2005 - 09:11:23 EST