Package org.dbunit.dataset

Examples of org.dbunit.dataset.Column$AutoIncrement


                close();
                throw new RowOutOfBoundsException(row + " > " + _lastRow);
            }

            int columnIndex = getColumnIndex(columnName);
            Column column = _metaData.getColumns()[columnIndex];
            return column.getDataType().getSqlValue(columnIndex + 1, _resultSet);
        }
        catch (SQLException e)
        {
            throw new DataSetException(e);
        }
View Full Code Here


            String type, String mode, String value) throws SAXException
    {
        // Each element attribute represent a table column
        Column.Nullable nullable = (REQUIRED.equals(mode)) ?
                Column.NO_NULLS : Column.NULLABLE;
        Column column = new Column(attributeName, DataType.UNKNOWN, nullable);

        if (!_columnListMap.containsKey(elementName))
        {
            _columnListMap.put(elementName, createColumnList());
        }
View Full Code Here

            List readData = parser.parse(url);
            List readColumns = (List) readData.get(0);
            Column[] columns = new Column[readColumns.size()];

            for (int i = 0; i < readColumns.size(); i++) {
                columns[i] = new Column((String) readColumns.get(i), DataType.UNKNOWN);
            }

            String tableName = url.getFile();
            tableName = tableName.substring(tableName.lastIndexOf("/")+1, tableName.indexOf(".csv"));
            ITableMetaData metaData = new DefaultTableMetaData(tableName, columns);
View Full Code Here

            List readData = parser.parse(theDataFile);
            List readColumns = ((List) readData.get(0));
            Column[] columns = new Column[readColumns.size()];

            for (int i = 0; i < readColumns.size(); i++) {
                columns[i] = new Column((String) readColumns.get(i), DataType.UNKNOWN);
            }

            String tableName = theDataFile.getName().substring(0, theDataFile.getName().indexOf(".csv"));
            ITableMetaData metaData = new DefaultTableMetaData(tableName, columns);
            _consumer.startTable(metaData);
View Full Code Here

            printOut.print(tableName);
            printOut.print("\n");
            Column[] columns = dataSet.getTableMetaData(tableName).getColumns();
            for (int j = 0; j < columns.length; j++)
            {
                Column column = columns[j];
                printOut.print("    ");
                printOut.print(column.getColumnName());
                if (column.getNullable() == Column.NO_NULLS)
                {
                    printOut.print(" CDATA #REQUIRED\n");
                }
                else
                {
View Full Code Here

            HSSFRow headerRow = sheet.createRow(0);
            Column[] columns = metaData.getColumns();
            for (int j = 0; j < columns.length; j++)
            {
                Column column = columns[j];
                HSSFCell cell = headerRow.createCell(j);
                cell.setCellValue(new HSSFRichTextString(column.getColumnName()));
            }
           
            // write table data
            for (int j = 0; j < table.getRowCount(); j++)
            {
                HSSFRow row = sheet.createRow(j + 1);
                for (int k = 0; k < columns.length; k++)
                {
                    Column column = columns[k];
                    Object value = table.getValue(j, column.getColumnName());
                    if (value != null)
                    {
                        HSSFCell cell = row.createCell(k);
                        if(value instanceof Date){
                            setDateCell(cell, (Date)value, workbook);
View Full Code Here

                                "The column name of column # {} is empty - will skip here assuming the last column was reached",
                                String.valueOf(i));
                break;
            }

            Column column = new Column(columnName, DataType.UNKNOWN);
            columnList.add(column);
           
            // Unique identification key
            byte underline = cell.getCellStyle().getFont(workbook).getUnderline();
            if (underline == 1) {
View Full Code Here

        final CachedDataSet dataSet = new CachedDataSet();
        dataSet.startDataSet();
        final List readColumns = ((List)readData.get(0));
        final Column[] columns = new Column[readColumns.size()];
        for (int i = 0; i < readColumns.size(); i++) {
            columns[i] = new Column((String)readColumns.get(i), DataType.UNKNOWN);
        }

        final ITableMetaData metaData = new DefaultTableMetaData(tableName, columns);
        dataSet.startTable(metaData);
        for (int rowIndex = 1; rowIndex < readData.size(); rowIndex++) {
View Full Code Here

TOP

Related Classes of org.dbunit.dataset.Column$AutoIncrement

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.