cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Øyvind Harboe (JIRA) <>
Subject [jira] Created: (CAY-1395) createSetAllowNullToDb() return incorrect SQL statement to createSql()
Date Wed, 24 Feb 2010 08:06:28 GMT
createSetAllowNullToDb() return incorrect SQL statement to createSql()

                 Key: CAY-1395
             Project: Cayenne
          Issue Type: Bug
          Components: Core Library
    Affects Versions: 3.0RC2
            Reporter: Øyvind Harboe
             Fix For: 3.0

The problem with createSql() is that it is executed *before* the property is changed.

The following kludge to SQLServerManagerFactory.createSetAllowNullToDb() works on my rocket...

        return new SetAllowNullToDb(entity, column) {

            public List<String> createSql(DbAdapter adapter) {
                StringBuffer sqlBuffer = new StringBuffer();

                QuotingStrategy context = adapter.getQuotingStrategy(getEntity()

                sqlBuffer.append("ALTER TABLE ");
                sqlBuffer.append(" ALTER COLUMN ");

                /* Kludge!!!! how should this be handled really??? */
                adapter.createTableAppendColumn(sqlBuffer, column);

                return Collections.singletonList(sqlBuffer.toString());

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message