Search in sources :

Example 1 with SortOrder

use of net.sourceforge.squirrel_sql.fw.sql.IndexInfo.SortOrder in project tdq-studio-se by Talend.

the class IndexNode method loadChildren.

/*
     * (non-Javadoc)
     * 
     * @see net.sourceforge.sqlexplorer.dbstructure.nodes.AbstractNode#loadChildren()
     */
public void loadChildren() {
    try {
        List<IndexInfo> infos = _session.getMetaData().getIndexInfo(_parentTable.getTableInfo());
        for (IndexInfo info : infos) {
            String indexName = info.getSimpleName();
            SortOrder sort = info.getSortOrder();
            if (indexName != null && indexName.equalsIgnoreCase(_name)) {
                ColumnNode col = new ColumnNode(this, info.getColumnName(), _session, _parentTable, true);
                if (sort == null || sort == SortOrder.ASC) {
                    col.setLabelDecoration("ASC");
                } else {
                    col.setLabelDecoration("DESC");
                }
                addChildNode(col);
            }
        }
    } catch (Exception e) {
        SQLExplorerPlugin.error("Could not load column names", e);
    }
}
Also used : SortOrder(net.sourceforge.squirrel_sql.fw.sql.IndexInfo.SortOrder) IndexInfo(net.sourceforge.squirrel_sql.fw.sql.IndexInfo)

Aggregations

IndexInfo (net.sourceforge.squirrel_sql.fw.sql.IndexInfo)1 SortOrder (net.sourceforge.squirrel_sql.fw.sql.IndexInfo.SortOrder)1