Package com.workingdogs.village

Examples of com.workingdogs.village.TableDataSet


                criteria.add(pk.getFullyQualifiedName(), id);
            }
        }

        // Use Village to perform the insert.
        TableDataSet tds = null;
        try
        {
            String tableName = SQLBuilder.getFullTableName(table, dbName);
            tds = new TableDataSet(con, tableName);
            Record rec = tds.addRecord();
            // not the fully qualified name, insertOrUpdateRecord wants to use table as an index...
            BasePeer.insertOrUpdateRecord(rec, table, dbName, criteria);
        }
        catch (Exception e)
        {
View Full Code Here


                    }
                }
            }

            // Execute the statement for each table
            TableDataSet tds = null;
            try
            {
                String tableName = SQLBuilder.getFullTableName(table, dbName);

                // Get affected records.
                tds = new TableDataSet(con, tableName, kd);
                String sqlSnippet = StringUtils.join(whereClause.iterator(), " AND ");

                if (log.isDebugEnabled())
                {
                    log.debug("BasePeer: whereClause=" + sqlSnippet);
                }

                tds.where(sqlSnippet);
                tds.fetchRecords();

                if (tds.size() > 1 && crit.isSingleRecord())
                {
                    handleMultipleRecords(tds);
                }

                for (int j = 0; j < tds.size(); j++)
                {
                    Record rec = tds.getRecord(j);

                    if (pc != null)
                    {
                        // Table name _without_ schema!
                        pc.process(table, dbName, rec);
View Full Code Here

                    }
                }
            }

            // Execute the statement.
            TableDataSet tds = null;
            try
            {
                tds = new TableDataSet(con, tab, kd);
                String sqlSnippet = StringUtils.join(whereClause.iterator(), " AND ");

                if (log.isDebugEnabled())
                {
                    log.debug("BasePeer.doDelete: whereClause=" + sqlSnippet);
                }

                tds.where(sqlSnippet);
                tds.fetchRecords();
                if (tds.size() > 1 && criteria.isSingleRecord())
                {
                    handleMultipleRecords(tds);
                }
                for (int j = 0; j < tds.size(); j++)
                {
                    Record rec = tds.getRecord(j);
                    rec.markToBeDeleted();
                    rec.save();
                }
            }
            catch (Exception e)
            {
                throwTorqueException(e);
            }
            finally
            {
                if (tds != null)
                {
                    try
                    {
                        tds.close();
                    }
                    catch (Exception ignored)
                    {
                    }
                }
View Full Code Here

                criteria.add(pk.getFullyQualifiedName(), id);
            }
        }

        // Use Village to perform the insert.
        TableDataSet tds = null;
        try
        {
            tds = new TableDataSet(con, tableName);
            Record rec = tds.addRecord();
            BasePeer.insertOrUpdateRecord(rec, tableName, criteria);
        }
        catch (Exception e)
        {
            throwTorqueException(e);
        }
        finally
        {
            if (tds != null)
            {
                try
                {
                    tds.close();
                }
                catch (Exception e)
                {
                    throwTorqueException(e);
                }
View Full Code Here

                criteria.add(pk.getFullyQualifiedName(), id);
            }
        }

        // Use Village to perform the insert.
        TableDataSet tds = null;
        try
        {
            String tableName = SQLBuilder.getFullTableName(table, dbName);
            tds = new TableDataSet(con, tableName);
            Record rec = tds.addRecord();
            // not the fully qualified name, insertOrUpdateRecord wants to use table as an index...
            BasePeer.insertOrUpdateRecord(rec, table, dbName, criteria);
        }
        catch (DataSetException e)
        {
View Full Code Here

                    }
                }
            }

            // Execute the statement for each table
            TableDataSet tds = null;
            try
            {
                String tableName = SQLBuilder.getFullTableName(table, dbName);

                // Get affected records.
                tds = new TableDataSet(con, tableName, kd);
                String sqlSnippet = StringUtils.join(whereClause.iterator(), " AND ");

                if (log.isDebugEnabled())
                {
                    log.debug("BasePeer: whereClause=" + sqlSnippet);
                }

                tds.where(sqlSnippet);
                tds.fetchRecords();

                if (tds.size() > 1 && crit.isSingleRecord())
                {
                    handleMultipleRecords(tds);
                }

                for (int j = 0; j < tds.size(); j++)
                {
                    Record rec = tds.getRecord(j);

                    if (pc != null)
                    {
                        // Table name _without_ schema!
                        pc.process(table, dbName, rec);
View Full Code Here

                    }
                }
            }

            // Execute the statement.
            TableDataSet tds = null;
            try
            {
                tds = new TableDataSet(connection, tables.get(i), kd);
                String sqlSnippet = whereClause.toString(" AND ");
                TurbineLogging.getLogger(TurbineConstants.SQL_LOG_FACILITY)
                    .debug("BasePeer.doDelete: whereClause=" + sqlSnippet);
                tds.where(sqlSnippet);
                tds.fetchRecords();
                if ( tds.size() > 1 && criteria.isSingleRecord() )
                {
                    handleMultipleRecords(tds);
                }
                for (int j=0; j<tds.size(); j++)
                {
                    Record rec = tds.getRecord(j);
                    rec.markToBeDeleted();
                    rec.save();
                }
            }
            finally
            {
                if (tds != null) tds.close();
            }
        }
    }
View Full Code Here

                criteria.add( pk.getFullyQualifiedName(), id );
            }
        }

        // Set up Village for the insert.
        TableDataSet tds = null;
        try
        {
            tds = new TableDataSet(dbCon.getConnection(), tableName );
            Record rec = tds.addRecord();
            insertOrUpdateRecord(rec, tableName, criteria);
        }
        finally
        {
            if (tds != null) tds.close();
        }

        // If the primary key column is auto-incremented, get the id
        // now.
        if ((keyGen != null) && (keyGen.isPostInsert()))
View Full Code Here

                            selectCriteria.isIgnoreCase(),
                            db ));
                    }
                }
            }
            TableDataSet tds = null;
            try
            {
                // Get affected records.
                tds = new TableDataSet(connection, tables.get(i), kd );
                String sqlSnippet = whereClause.toString(" AND ");
                TurbineLogging.getLogger(TurbineConstants.SQL_LOG_FACILITY)
                    .debug("BasePeer.doUpdate: whereClause=" + sqlSnippet);
                tds.where(sqlSnippet);
                tds.fetchRecords();

                if ( tds.size() > 1 && selectCriteria.isSingleRecord() )
                {
                    handleMultipleRecords(tds);
                }
                for (int j=0; j<tds.size(); j++)
                {
                    Record rec = tds.getRecord(j);
                    insertOrUpdateRecord(rec, tables.get(i), updateValues);
                }
            }
            finally
            {
                if (tds != null) tds.close();
            }
        }
    }
View Full Code Here

                                selectCriteria.isIgnoreCase(),
                                db));
                    }
                }
            }
            TableDataSet tds = null;
            try
            {
                // Get affected records.
                tds = new TableDataSet(con, tab, kd);
                String sqlSnippet = StringUtils.join(whereClause.iterator(), " AND ");
                if (log.isDebugEnabled())
                {
                    log.debug("BasePeer.doUpdate: whereClause=" + sqlSnippet);
                }
                tds.where(sqlSnippet);
                tds.fetchRecords();

                if (tds.size() > 1 && selectCriteria.isSingleRecord())
                {
                    handleMultipleRecords(tds);
                }
                for (int j = 0; j < tds.size(); j++)
                {
                    Record rec = tds.getRecord(j);
                    BasePeer.insertOrUpdateRecord(rec, tab, updateValues);
                }
            }
            catch (Exception e)
            {
                throwTorqueException(e);
            }
            finally
            {
                if (tds != null)
                {
                    try
                    {
                        tds.close();
                    }
                    catch (Exception e)
                    {
                        throwTorqueException(e);
                    }
View Full Code Here

TOP

Related Classes of com.workingdogs.village.TableDataSet

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.