Examples of IndexColumn


Examples of org.h2.table.IndexColumn

            Column[] tableCols = table.getColumns();
            int len = columns.length;
            IndexColumn[] cols = new IndexColumn[len];
            for (int i = 0; i < len; i++) {
                String c = columns[i];
                IndexColumn ic = new IndexColumn();
                int idx = c.indexOf('/');
                if (idx >= 0) {
                    String s = c.substring(idx + 1);
                    ic.sortType = Integer.parseInt(s);
                    c = c.substring(0, idx);
View Full Code Here

Examples of org.h2.table.IndexColumn

                }
                boolean ok = true;
                for (int j = 0; j < sortCols.length; j++) {
                    // the index and the sort order must start
                    // with the exact same columns
                    IndexColumn idxCol = indexCols[j];
                    Column sortCol = sortCols[j];
                    if (idxCol.column != sortCol) {
                        ok = false;
                        break;
                    }
View Full Code Here

Examples of org.jboss.dna.common.jdbc.model.api.IndexColumn

    }

    public void testAddColumn() {
        String COLUMN_NAME = "My column";
        // create column
        IndexColumn column = new DefaultModelFactory().createIndexColumn();
        // set name
        column.setName(COLUMN_NAME);
        // add column
        bean.addColumn(column);
        // check
        assertFalse("Column set should not be empty", bean.getColumns().isEmpty());
    }
View Full Code Here

Examples of org.jboss.dna.common.jdbc.model.api.IndexColumn

    }

    public void testDeleteColumn() {
        String COLUMN_NAME = "My column";
        // create column
        IndexColumn column = new DefaultModelFactory().createIndexColumn();
        // set name
        column.setName(COLUMN_NAME);
        // add column
        bean.addColumn(column);
        // check
        assertFalse("Column set should not be empty", bean.getColumns().isEmpty());
View Full Code Here

Examples of org.jboss.dna.common.jdbc.model.api.IndexColumn

    }

    public void testFindColumnByName() {
        String COLUMN_NAME = "My column";
        // create column
        IndexColumn column = new DefaultModelFactory().createIndexColumn();
        // set name
        column.setName(COLUMN_NAME);
        // add column
        bean.addColumn(column);
        // check
        assertSame("Unable to find column", column, bean.findColumnByName(COLUMN_NAME));
    }
View Full Code Here

Examples of org.jboss.dna.common.jdbc.model.api.IndexColumn

                    throw new DatabaseMetaDataMethodException(errMessage, "populateIndexes");

                }

                // create index column
                IndexColumn indexColumn = factory.createIndexColumn();

                // check if we found the original table column
                if (tableColumn != null) {
                    // mark original table column as part of index
                    tableColumn.setIndexColumn(Boolean.TRUE);
                    // clone properties from original table column to the index column
                    PropertyUtils.copyProperties(indexColumn, tableColumn);
                } else { // recovery if table column is not found but we still want to create index column
                    // set name at least
                    indexColumn.setName(indexColumnName);
                }
                // modify ordinal position that correspond to the position in index
                indexColumn.setOrdinalPosition(ordinalPosition);
                // sort sequence type
                indexColumn.setSortSequenceType(getSortSequenceType(ascOrDesc));

                // add index column to the index
                index.addColumn(indexColumn);
            }
View Full Code Here

Examples of org.lealone.dbobject.table.IndexColumn

                Value v = condition.getCurrentValue(s);
                boolean isStart = condition.isStart();
                boolean isEnd = condition.isEnd();
                int id = column.getColumnId();
                if (id >= 0) {
                    IndexColumn idxCol = indexColumns[id];
                    if (idxCol != null && (idxCol.sortType & SortOrder.DESCENDING) != 0) {
                        // if the index column is sorted the other way, we swap end and start
                        // NULLS_FIRST / NULLS_LAST is not a problem, as nulls never match anyway
                        boolean temp = isStart;
                        isStart = isEnd;
View Full Code Here

Examples of org.lealone.dbobject.table.IndexColumn

        // IndexCondition.getMask.
        IndexColumn[] cols = index.getIndexColumns();
        if (cols == null) {
            return true;
        }
        IndexColumn idxCol = cols[0];
        return idxCol == null || idxCol.column == column;
    }
View Full Code Here

Examples of org.lealone.dbobject.table.IndexColumn

        data.persistData = true;
        data.create = true;
        data.session = session;
        table = (TableBase) schema.createTable(data);
        int indexId = db.allocateObjectId();
        IndexColumn indexColumn = new IndexColumn();
        indexColumn.column = column;
        indexColumn.columnName = COLUMN_NAME;
        IndexType indexType;
        indexType = IndexType.createPrimaryKey(true, false);
        IndexColumn[] indexCols = { indexColumn };
View Full Code Here

Examples of org.lealone.dbobject.table.IndexColumn

    }

    private IndexColumn[] parseIndexColumnList() {
        ArrayList<IndexColumn> columns = New.arrayList();
        do {
            IndexColumn column = new IndexColumn();
            column.columnName = readColumnIdentifier();
            if (readIf(".")) {
                column.columnFamilyName = column.columnName;
                column.columnName = readColumnIdentifier();
            }
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.