Package org.apache.metamodel.data

Examples of org.apache.metamodel.data.DefaultRow


            final String value = valueMap.get(fieldName);
            final Object parsedValue = convert(value, column.getType());
            values[i] = parsedValue;
        }

        return new DefaultRow(header, values);
    }
View Full Code Here


                // use original value
                value = original.getValue(i);
            }
            values[i] = value;
        }
        return new DefaultRow(new SimpleDataSetHeader(items), values);
    }
View Full Code Here

                            if (count == null) {
                                logger.debug("DataContext did not return any count query results. Proceeding with manual counting.");
                            } else {
                                List<Row> data = new ArrayList<Row>(1);
                                final DataSetHeader header = new SimpleDataSetHeader(new SelectItem[] { selectItem });
                                data.add(new DefaultRow(header, new Object[] { count }));
                                return new InMemoryDataSet(header, data);
                            }
                        }
                    }
                }
View Full Code Here

            for (Table t : tables) {
                String typeString = null;
                if (t.getType() != null) {
                    typeString = t.getType().toString();
                }
                data.add(new DefaultRow(header, new Object[] { t.getName(), typeString, t.getColumnCount(),
                        t.getRemarks() }));
            }
        } else if ("columns".equals(tableName)) {
            // "columns" columns: name, type, native_type, size, nullable,
            // indexed, table, remarks
            for (Table t : tables) {
                for (Column c : t.getColumns()) {
                    String typeString = null;
                    if (t.getType() != null) {
                        typeString = c.getType().toString();
                    }
                    data.add(new DefaultRow(header, new Object[] { c.getName(), typeString, c.getNativeType(),
                            c.getColumnSize(), c.isNullable(), c.isIndexed(), t.getName(), c.getRemarks() }));
                }
            }
        } else if ("relationships".equals(tableName)) {
            // "relationships" columns: primary_table, primary_column,
            // foreign_table, foreign_column
            for (Relationship r : getMainSchemaInternal().getRelationships()) {
                Column[] primaryColumns = r.getPrimaryColumns();
                Column[] foreignColumns = r.getForeignColumns();
                Table pTable = r.getPrimaryTable();
                Table fTable = r.getForeignTable();
                for (int i = 0; i < primaryColumns.length; i++) {
                    Column pColumn = primaryColumns[i];
                    Column fColumn = foreignColumns[i];
                    data.add(new DefaultRow(header, new Object[] { pTable.getName(), pColumn.getName(),
                            fTable.getName(), fColumn.getName() }));
                }
            }
        } else {
            throw new IllegalArgumentException("Cannot materialize non information_schema table: " + table);
View Full Code Here

        final Iterator<Row> rowIterator = ExcelUtils.getRowIterator(sheet, _updateCallback.getConfiguration(), true);
        final List<Row> rowsToDelete = new ArrayList<Row>();
        while (rowIterator.hasNext()) {
            final Row excelRow = rowIterator.next();
            final DefaultRow row = ExcelUtils.createRow(workbook, excelRow, header);

            final boolean deleteRow = deleteRow(row);
            if (deleteRow) {
                rowsToDelete.add(excelRow);
            }
View Full Code Here

            final SelectItem selectItem = getHeader().getSelectItem(i);
            final String column = selectItem.getColumn().getName();
            values[i] = _pojoTable.getValue(column, _next);
        }

        return new DefaultRow(getHeader(), values);
    }
View Full Code Here

                values[i] = value;
                styles[i] = style;
            }
        }

        return new DefaultRow(header, values, styles);
    }
View Full Code Here

        }

        final DataSetHeader header = new CachingDataSetHeader(selectItems);
        final List<Row> rows = new ArrayList<Row>(data.size());
        for (Object[] objects : data) {
            rows.add(new DefaultRow(header, objects, null));
        }

        DataSet result = new InMemoryDataSet(header, rows);
        if (whereItems != null) {
            DataSet filteredResult = getFiltered(result, whereItems);
View Full Code Here

        // Ticket #125: Missing values should be enterpreted as
        // null.
        rowValues[i] = null;
      }
    }
    _row = new DefaultRow(getHeader(), rowValues);

    if (exception != null) {
      throw new InconsistentValueWidthException(_row, exception);
    }
    return true;
View Full Code Here

                            }
                        }
                    }
                    i++;
                }
                resultData.add(new DefaultRow(resultHeader, resultRow, null));
            }

            if (resultData.isEmpty()) {
                result = new EmptyDataSet(selectItems);
            } else {
View Full Code Here

TOP

Related Classes of org.apache.metamodel.data.DefaultRow

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.