Fixing MySQL

From: Holger Hoffstätte (holge..izards.de)
Date: Mon May 12 2003 - 05:59:17 EDT

  • Next message: Holger Hoffstätte: "Re: Fixing MySQL"

    I looked again at preventing MySQL from writing default values into NOT
    NULL columns and obviously Insert/UpdateTranslator subclassea are the way
    to go - nifty. InsertTranslator should be easy (substitute NULL for
    missing values to prevent defaults, which will then be handled correctly)
    but UPDATE is not so clear, since it does indeed work even with explicit
    NULL:

    mysql> update artist set artist_name = NULL where artist_id = 1;
    Query OK, 1 row affected (0.00 sec)
    Rows matched: 1 Changed: 1 Warnings: 1

    So the only way would be to check the mapping and throw an Exception if a
    NULL is given for a NOT NULL DbAttribute.

    Any other thoughts or suggestions?

    Holger



    This archive was generated by hypermail 2.0.0 : Mon May 12 2003 - 05:59:19 EDT