Examples of TableWrapper


Examples of org.apache.tuscany.das.rdb.config.wrapper.TableWrapper

        super();
    }

    //JIRA-952
    private String getDeleteStatement(MappingWrapper mapping, Table t) {
        TableWrapper table = new TableWrapper(t);

        StringBuffer statement = new StringBuffer();
        statement.append("delete from ");
        if(mapping.getConfig().isDatabaseSchemaNameSupported()){
          statement.append(t.getSchemaName()+"."+t.getTableName());
        }
        else{
        statement.append(t.getTableName());
        }
        statement.append(" where ");

        Iterator names = table.getPrimaryKeyNames().iterator();
        Iterator properties = table.getPrimaryKeyProperties().iterator();
        while (names.hasNext() && properties.hasNext()) {
            String name = (String) names.next();
            statement.append(name);
            statement.append(" = ?");
            if (names.hasNext() && properties.hasNext()) {
View Full Code Here

Examples of org.apache.tuscany.das.rdb.config.wrapper.TableWrapper

        return statement.toString();
    }

    public DeleteCommandImpl getDeleteCommand(MappingWrapper mapping, Table t) {
        TableWrapper tw = new TableWrapper(t);
        DeleteCommandImpl deleteCommand = new DeleteCommandImpl(getDeleteStatement(mapping, t));

        Iterator i = tw.getPrimaryKeyProperties().iterator();
        for (int idx = 1; i.hasNext(); idx++) {
            String property = (String) i.next();
            ParameterImpl p = new ParameterImpl();
            p.setName(property);
            p.setType(SDODataTypes.OBJECT);
            p.setConverter(getConverter(tw.getConverter(property)));
            p.setIndex(idx);
            deleteCommand.addParameter(p);
        }
        return deleteCommand;
    }
View Full Code Here

Examples of org.apache.tuscany.das.rdb.config.wrapper.TableWrapper

            if (rel.isKeyRestricted()) {
                throw new RuntimeException("Can not modify a one to one relationship that is key restricted");
            }
            // This is a one-one relationship
            Table t = mapping.getTableByTypeName(changedObject.getType().getName());
            TableWrapper tw = new TableWrapper(t);
            RelationshipWrapper rw = new RelationshipWrapper(rel);
            if ((rel.getForeignKeyTable().equals(t.getTableName()))
                    && (Collections.disjoint(tw.getPrimaryKeyProperties(), rw.getForeignKeys()))) {
                return true;
            }

        }
View Full Code Here

Examples of org.jboss.arquillian.persistence.dbunit.dataset.TableWrapper

      for (String tableName : tableNames)
      {
         final List<String> columnsForSorting = defineColumnsForSorting(filteredCurrentDataSet, expectedDataSet, tableName);

         final ITable expectedTable = sort(new TableWrapper(expectedDataSet.getTable(tableName), filteredCurrentDataSet.getTable(tableName).getTableMetaData()), columnsForSorting);
         final ITable currentTable = sort(filteredCurrentDataSet.getTable(tableName), columnsForSorting);

         final List<String> columnsToIgnore = extractColumnsToBeIgnored(expectedDataSet.getTable(tableName),
               filteredCurrentDataSet.getTable(tableName));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.