0 Replies Latest reply on Mar 15, 2005 10:22 AM by Eitan Gur

    blob default values

    Eitan Gur Newbie

      Hi

      I'm using jboss 3.2.5 with mysql 4.1.7.
      I have a table named MASContentEntity, mapped to an entity bean:

      <entity>
       <display-name>MASContentEntity</display-name>
       <ejb-name>MASContentEntity</ejb-name>
       <local-home>messaging_as.domain.MASContentEntityLocalHome</local-home>
       <local>messaging_as.domain.MASContentEntity</local>
       <ejb-class>messaging_as.domain.MASContentEntityBean</ejb-class>
       <persistence-type>Container</persistence-type>
       <prim-key-class>java.lang.Integer</prim-key-class>
       <reentrant>False</reentrant>
       <cmp-version>2.x</cmp-version>
       <abstract-schema-name>MASContentEntity</abstract-schema-name>
       <cmp-field>
       <field-name>data</field-name>
       </cmp-field>
       <cmp-field>
       <field-name>contentid</field-name>
       </cmp-field>
       <cmp-field>
       <field-name>filename</field-name>
       </cmp-field>
       <cmp-field>
       <field-name>preview</field-name>
       </cmp-field>
       <primkey-field>contentid</primkey-field>
       </entity>
      

      Where data and preview are blobs, and filename is varchar(250).

      When I check the mysql create table, I see the following:
      mascontententity | CREATE TABLE `mascontententity` (
      `contentid` int(11) NOT NULL default '0',
      `data` longblob,
      `filename` varchar(250) character set utf8 collate utf8_bin default NULL,
      `preview` longblob,
      `masObjectEntity` int(11) default NULL,
      PRIMARY KEY (`contentid`),
      KEY `fk_MASContentEntity_masObjectEntity` (`masObjectEntity`),
      CONSTRAINT `fk_MASContentEntity_masObjectEntity` FOREIGN KEY (`masObjectEntity`) REFERENCES `masobjectentity` (`objectId`)
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8


      The problem is that neither the data nor the preview fields are set to default NULL as the filename field. I tried to find where can I define this, but couldn't.

      Please help..

      10x