Package com.sun.jdo.spi.persistence.support.sqlstore.sql

Examples of com.sun.jdo.spi.persistence.support.sqlstore.sql.UpdateJoinTableDesc


            ColumnElement c = (ColumnElement) f.assocLocalColumns.get(0);
            QueryTable t = addQueryTable(config.findTableDesc(c.getDeclaringTable()));

            while (descIter.hasNext()) {
                UpdateJoinTableDesc desc = (UpdateJoinTableDesc) descIter.next();
                int action = getAction(desc.getAction());

                UpdateStatement s = (UpdateStatement) createStatement(t);
                s.setAction(action);

                if (action == ACT_INSERT) {
                    insertStatements.add(s);
                } else if (action == ACT_DELETE) {

                    // RESOLVE: There are redundant deletes from join tables that causes
                    // update to fail with no rows affected. To work around this problem
                    // for now, we set the minAffectedRows to 0.
                    // We need to figure out why there are redundant deletes.

                    s.minAffectedRows = 0;
                    deleteStatements.add(s);
                }

                s.addLocalConstraints(action, f, desc.getParentStateManager());
                s.addForeignConstraints(action, f, desc.getForeignStateManager());
            }
        }

        // All join table delete statements have to go first and all
        // join table insert statements have to go last.
View Full Code Here


            ColumnElement c = (ColumnElement) f.assocLocalColumns.get(0);
            QueryTable t = addQueryTable(config.findTableDesc(c.getDeclaringTable()));

            while (descIter.hasNext()) {
                UpdateJoinTableDesc desc = (UpdateJoinTableDesc) descIter.next();
                int action = getAction(desc.getAction());

                UpdateStatement s = (UpdateStatement) createStatement(t);
                s.setAction(action);

                if (action == ACT_INSERT) {
                    insertStatements.add(s);
                } else if (action == ACT_DELETE) {

                    // RESOLVE: There are redundant deletes from join tables that causes
                    // update to fail with no rows affected. To work around this problem
                    // for now, we set the minAffectedRows to 0.
                    // We need to figure out why there are redundant deletes.

                    s.minAffectedRows = 0;
                    deleteStatements.add(s);
                }

                s.addLocalConstraints(action, f, desc.getParentStateManager());
                s.addForeignConstraints(action, f, desc.getForeignStateManager());
            }
        }

        // All join table delete statements have to go first and all
        // join table insert statements have to go last.
View Full Code Here

TOP

Related Classes of com.sun.jdo.spi.persistence.support.sqlstore.sql.UpdateJoinTableDesc

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.