1 Reply Latest reply on Oct 6, 2003 6:32 AM by anajavi

    Sybase and NOT NULL columns

    anajavi Newbie

      When using JBoss CMP to create tables on Sybase, all fields are NOT NULL.
      Is there a way to prevent this?

      Sybase uses strange syntax where you have to define nullable columns instead of NOT NULL columns. For example:
      VARCHAR(255) NULL.

        • 1. Re: Sybase and NOT NULL columns
          anajavi Newbie

          Actually I found how to do it by modificating JBoss source:
          org.jboss.ejb.plugins.cmp.jdbc.SQLUtil has the following:

          buf.append(columnNames).append(" ").append(sqlTypes);
          if(notNull) {
          buf.append(" NOT NULL");
          }

          by adding:
          else {
          buf.append(" NULL");
          }

          Seems to work with PostgreSQL at least. Do not know if it breaks other db's.
          Is it possible to have this kind of modification on JBoss source?