Examples of ColumnName


Examples of com.carmanconsulting.cassidy.pojo.annotation.ColumnName

        }
        return columnName;
    }

    private static String columnNameOf(Field field) {
        ColumnName annotation = field.getAnnotation(ColumnName.class);
        return annotation == null ? field.getName() : annotation.value();
    }
View Full Code Here

Examples of com.carmanconsulting.cassidy.pojo.annotation.ColumnName

        }
        return columnName;
    }

    private static String columnNameOf(Field field) {
        ColumnName annotation = field.getAnnotation(ColumnName.class);
        return annotation == null ? field.getName() : annotation.value();
    }
View Full Code Here

Examples of com.foundationdb.ais.model.ColumnName

    protected void doEvaluate(TExecutionContext context,
                              LazyList<? extends ValueSource> inputs,
                              ValueTarget output) {
        String[] parts = { "", "", "" };
        if(covering.length == 1) {
            ColumnName columnName = ColumnName.parse("", inputs.get(0).getString());
            parts[0] = columnName.getTableName().getSchemaName();
            parts[1] = columnName.getTableName().getTableName();
            parts[2] = columnName.getName();
        } else {
            for(int i = covering.length - 1, j = 2; i >= 0; --i, --j) {
                parts[j] = inputs.get(i).getString();
            }
        }
View Full Code Here

Examples of com.foundationdb.ais.model.ColumnName

                String oldName = column.getName();
                boolean isTargetTable = column.getTable() == oldTable;
                String newName = isTargetTable ? findNewName(state.columnChanges, oldName) : oldName;
                if(newName != null) {
                    TableName tableName = isTargetTable ? newTable.getName() : column.getTable().getName();
                    remainingCols.add(new ColumnName(tableName, newName));
                    if(column.getTable() == oldTable) {
                        Column oldColumn = oldTable.getColumn(oldName);
                        Column newColumn = newTable.getColumn(newName);
                        dataChange |= (compare(oldColumn, newColumn) == ChangeLevel.TABLE);
                    }
View Full Code Here

Examples of com.foundationdb.ais.model.ColumnName

    protected void doEvaluate(TExecutionContext context,
                              LazyList<? extends ValueSource> inputs,
                              ValueTarget output) {
        String[] parts = { "", "", "" };
        if(covering.length == 1) {
            ColumnName columnName = ColumnName.parse("", inputs.get(0).getString());
            parts[0] = columnName.getTableName().getSchemaName();
            parts[1] = columnName.getTableName().getTableName();
            parts[2] = columnName.getName();
        } else {
            for(int i = covering.length - 1, j = 2; i >= 0; --i, --j) {
                parts[j] = inputs.get(i).getString();
            }
        }
View Full Code Here

Examples of com.salesforce.phoenix.parse.ColumnName

            Arrays.fill(columnIndexesToBe, -1); // TODO: necessary? So we'll get an AIOB exception if it's not replaced
            Arrays.fill(pkSlotIndexesToBe, -1); // TODO: necessary? So we'll get an AIOB exception if it's not replaced
            BitSet pkColumnsSet = new BitSet(table.getPKColumns().size());
            int i = 0;
            for (i = 0; i < numColsInUpsert; i++) {
                ColumnName colName = columnNodes.get(i);
                ColumnRef ref = resolver.resolveColumn(null, colName.getFamilyName(), colName.getColumnName());
                PColumn column = ref.getColumn();
                byte[] viewValue = addViewColumns.remove(ref);
                if (viewValue != null) {
                    if (overlapViewColumns.isEmpty()) {
                        overlapViewColumns = Maps.newHashMapWithExpectedSize(addViewColumns.size());
View Full Code Here

Examples of com.salesforce.phoenix.parse.ColumnName

        colUpsert.execute();
    }

    private PColumn newColumn(int position, ColumnDef def, PrimaryKeyConstraint pkConstraint) throws SQLException {
        try {
            ColumnName columnDefName = def.getColumnDefName();
            ColumnModifier columnModifier = def.getColumnModifier();
            boolean isPK = def.isPK();
            if (pkConstraint != null) {
                Pair<ColumnName,ColumnModifier> pkColumnModifier = pkConstraint.getColumn(columnDefName);
                if (pkColumnModifier != null) {
                    isPK = true;
                    columnModifier = pkColumnModifier.getSecond();
                }
            }
           
            String columnName = columnDefName.getColumnName();
            PName familyName = null;
            if (def.isPK() && !pkConstraint.getColumnNames().isEmpty() ) {
                throw new SQLExceptionInfo.Builder(SQLExceptionCode.PRIMARY_KEY_ALREADY_EXISTS)
                    .setColumnName(columnName).build().buildException();
            }
View Full Code Here

Examples of com.salesforce.phoenix.parse.ColumnName

                List<Pair<ColumnName, ColumnModifier>> allPkColumns = Lists.newArrayListWithExpectedSize(unusedPkColumns.size());
                List<ColumnDef> columnDefs = Lists.newArrayListWithExpectedSize(includedColumns.size() + indexedPkColumns.size());
               
                // First columns are the indexed ones
                for (Pair<ColumnName, ColumnModifier> pair : indexedPkColumns) {
                    ColumnName colName = pair.getFirst();
                    PColumn col = resolver.resolveColumn(null, colName.getFamilyName(), colName.getColumnName()).getColumn();
                    unusedPkColumns.remove(col);
                    PDataType dataType = IndexUtil.getIndexColumnDataType(col);
                    colName = ColumnName.caseSensitiveColumnName(IndexUtil.getIndexColumnName(col));
                    allPkColumns.add(new Pair<ColumnName, ColumnModifier>(colName, pair.getSecond()));
                    columnDefs.add(FACTORY.columnDef(colName, dataType.getSqlTypeName(), col.isNullable(), col.getMaxLength(), col.getScale(), false, null));
                }
               
                // Next all the PK columns from the data table that aren't indexed
                if (!unusedPkColumns.isEmpty()) {
                    for (PColumn col : unusedPkColumns) {
                        ColumnName colName = ColumnName.caseSensitiveColumnName(IndexUtil.getIndexColumnName(col));
                        allPkColumns.add(new Pair<ColumnName, ColumnModifier>(colName, col.getColumnModifier()));
                        PDataType dataType = IndexUtil.getIndexColumnDataType(col);
                        columnDefs.add(FACTORY.columnDef(colName, dataType.getSqlTypeName(), col.isNullable(), col.getMaxLength(), col.getScale(), false, col.getColumnModifier()));
                    }
                }
                pk = FACTORY.primaryKey(null, allPkColumns);
               
                // Last all the included columns (minus any PK columns)
                for (ColumnName colName : includedColumns) {
                    PColumn col = resolver.resolveColumn(null, colName.getFamilyName(), colName.getColumnName()).getColumn();
                    if (SchemaUtil.isPKColumn(col)) {
                        if (!unusedPkColumns.contains(col)) {
                            throw new SQLExceptionInfo.Builder(SQLExceptionCode.COLUMN_EXIST_IN_DEF).build().buildException();
                        }
                    } else {
View Full Code Here

Examples of com.salesforce.phoenix.parse.ColumnName

                    .build().buildException();
            }
            if (!pkColumnsNames.isEmpty() && pkColumnsNames.size() != pkColumns.size() - positionOffset) { // Then a column name in the primary key constraint wasn't resolved
                Iterator<Pair<ColumnName,ColumnModifier>> pkColumnNamesIterator = pkColumnsNames.iterator();
                while (pkColumnNamesIterator.hasNext()) {
                    ColumnName colName = pkColumnNamesIterator.next().getFirst();
                    ColumnDef colDef = findColumnDefOrNull(colDefs, colName);
                    if (colDef == null) {
                        throw new ColumnNotFoundException(schemaName, tableName, null, colName.getColumnName());
                    }
                    if (colDef.getColumnDefName().getFamilyName() != null) {
                        throw new SQLExceptionInfo.Builder(SQLExceptionCode.PRIMARY_KEY_WITH_FAMILY_NAME)
                        .setSchemaName(schemaName)
                        .setTableName(tableName)
View Full Code Here

Examples of com.salesforce.phoenix.parse.ColumnName

                        } else { // If adding to primary key, then add the same column to all indexes on the table
                            isAddingPKColumn = true;
                            for (PTable index : table.getIndexes()) {
                                int indexColPosition = index.getColumns().size();
                                PDataType indexColDataType = IndexUtil.getIndexColumnDataType(column);
                                ColumnName indexColName = ColumnName.caseSensitiveColumnName(IndexUtil.getIndexColumnName(column));
                                ColumnDef indexColDef = FACTORY.columnDef(indexColName, indexColDataType.getSqlTypeName(), column.isNullable(), column.getMaxLength(), column.getScale(), true, column.getColumnModifier());
                                PColumn indexColumn = newColumn(indexColPosition, indexColDef, PrimaryKeyConstraint.EMPTY);
                                addColumnMutation(schemaName, index.getTableName().getString(), indexColumn, colUpsert, index.getParentTableName().getString());
                            }
                        }
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.