RIAwolf / dao-ext

Automatically exported from code.google.com/p/dao-ext
0 stars 0 forks source link

Generated DAO is incorrect #9

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
For the table:

CREATE TABLE IF NOT EXISTS ALUNO (
       NR_ALUNO INTEGER NOT NULL,
       TURMA_ID INTEGER NOT NULL,
   ...
       PRIMARY KEY(NR_ALUNO,TURMA_ID)
);

The generated deleteRow is:

public function deleteRow( rowItem:ALUNOVO, resultHandler:Function = null,
faultHandler:Function = null ):void {
            var stmt:SQLStatement = new SQLStatement();
            stmt.sqlConnection = sqlConnection;
            stmt.text = 'DELETE FROM ALUNO WHERE TURMA_ID = primaryKey.TURMA_ID;';
            stmt.addEventListener( SQLEvent.RESULT,
            function ( event:SQLEvent ):void {
                if (resultHandler != null) resultHandler.call(this, rowItem);
            });
            stmt.addEventListener( SQLErrorEvent.ERROR, faultHandler == null ?
sqlErrorHandler : faultHandler );
            stmt.execute();
        }

Which is incorrect!

Original issue reported on code.google.com by martins....@gmail.com on 11 Mar 2009 at 6:32

GoogleCodeExporter commented 8 years ago
Actually Dao-Ext manage only tables with a single primary key and a single 
autoincrement field, usually the 
primary key. We've planned management of multiple primary keys for next update.

thanks for your effort

Original comment by matteo.r...@gmail.com on 12 Mar 2009 at 9:23

GoogleCodeExporter commented 8 years ago
fixed in source code, also fixed if you use built-in auto-update 
functionalities.

Original comment by matteo.r...@gmail.com on 12 Mar 2009 at 12:40