Package com.foundationdb.server.rowdata

Examples of com.foundationdb.server.rowdata.FieldDef


        }
        RowDataValueSource valueSource = new RowDataValueSource();
        int nfields = rowDef.getFieldCount();
        Map<String,Object> value = new HashMap<>(nfields); // Intermediate form of value.
        for (int i = 0; i < nfields; i++) {
            FieldDef fieldDef = rowDef.getFieldDef(i);
            valueSource.bind(fieldDef, rowData);
            value.put(fieldDef.getName(), ValueSources.toObject(valueSource));
        }
        storeData.otherValue = value;
    }
View Full Code Here


                if (indexField == index.firstSpatialArgument()) {
                    pKeyAppends++;
                }
            } else {
                if (indexRowComp.isInRowData(indexField)) {
                    FieldDef fieldDef = fieldDefs[indexRowComp.getFieldPosition(indexField)];
                    Column column = fieldDef.column();
                    rowDataValueSource.bind(fieldDef, rowData);
                    pKeyTarget().append(rowDataValueSource,
                                        column.getType());
                } else if (indexRowComp.isInHKey(indexField)) {
                    PersistitKey.appendFieldFromKey(pKey(), hKey, indexRowComp.getHKeyPosition(indexField), index
View Full Code Here

    protected void fillIdentityColumn(Session session, NewRow row) {
        Table table = row.getRowDef().table();
        Column idColumn = table.getIdentityColumn();
        if (idColumn != null) {
            FieldDef fieldDef = idColumn.getFieldDef();
            Boolean defaultIdentity = idColumn.getDefaultIdentity();
            if (defaultIdentity == false ||
                    (defaultIdentity == true && row.isColumnNull(fieldDef.getFieldIndex()))) {
                Sequence sequence = idColumn.getIdentityGenerator();
                Long value = this.nextSequenceValue(session, sequence);
                row.put(fieldDef.getFieldIndex(), value);
            }
        }
    }
View Full Code Here

        throw new UnsupportedOperationException();
    }

    @Override
    public ValueSource value(int i) {
        FieldDef fieldDef = index.getAllColumns().get(i).getColumn().getFieldDef();
        int fieldPos = fieldDef.getFieldIndex();
        Object value = row.get(fieldPos);
        TInstance type = rowType.typeAt(fieldPos);
        if (DEBUG_ROWTYPE && type == null && value != null) {
            throw new RowType.InconsistentRowTypeException(i, value);
        }
View Full Code Here

        return false;
    }

    @Override
    public ValueSource uncheckedValue(int i) {
        FieldDef fieldDef = rowType.table().rowDef().getFieldDef(i);
        RowDataValueSource valueSource = valueSource(i);
        valueSource.bind(fieldDef, rowData);
        return valueSource;
    }
View Full Code Here

    protected void confirmColumn(RowDef rowDef, Integer expectedId, String columnName) {
        assert columnName != null;
        assert rowDef != null;
        assertNotNull("column ID for " + columnName, expectedId);
        FieldDef fieldDef = rowDef.getFieldDef(expectedId);
        assertNotNull("no fieldDef with id="+expectedId + ", name="+columnName, fieldDef);
        assertEquals("fieldDef name", columnName, fieldDef.getName());
    }
View Full Code Here

    }

    @Test
    public void decimalField() throws Exception {
        final int tid = createTableFromTypes(SCHEMA, TABLE, false, false, new SimpleColumn("c2", "MCOMPAT_ decimal", 5L, 2L));
        final FieldDef fieldDef = getTable(tid).getColumn("c2").getFieldDef();
        testObjectToKey(fieldDef,
                        null, BigDecimal.valueOf(-12345, 2), 578L, "999.99");
    }
View Full Code Here

    }

    @Test
    public void decimalUnsignedField() throws Exception {
        final int tid = createTableFromTypes(SCHEMA, TABLE, false, true, new SimpleColumn("c2", "MCOMPAT_ decimal", 5L, 2L));
        final FieldDef fieldDef = getTable(tid).getColumn("c2").getFieldDef();
        testObjectToKey(fieldDef,
                        null, BigDecimal.valueOf(0), BigDecimal.valueOf(4242, 2), 489L, "978.83");
    }
View Full Code Here

        return adapter.schema().tableRowType(rowDef().table());
    }

    @Override
    public ValueSource uncheckedValue(int i) {
        FieldDef fieldDef = rowDef().getFieldDef(i);
        RowData rowData = rowData();
        RowDataValueSource valueSource = ValueSource(i);
        valueSource.bind(fieldDef, rowData);
        return valueSource;
    }
View Full Code Here

                                                   RowData childRowData) {
        Key parentPkKey = storeData.persistitKey;
        PersistitKeyAppender keyAppender = PersistitKeyAppender.create(parentPkKey, parentPKIndex.getIndexName());
        int[] fields = childRowDef.getParentJoinFields();
        for(int field : fields) {
            FieldDef fieldDef = childRowDef.getFieldDef(field);
            keyAppender.append(fieldDef, childRowData);
        }

        // Only called when child row does not contain full HKey.
        // Key contents are the logical parent of the actual index entry (if it exists).
View Full Code Here

TOP

Related Classes of com.foundationdb.server.rowdata.FieldDef

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.