Skip to content

Commit

Permalink
Now reports whether indexes are ascending or descending
Browse files Browse the repository at this point in the history
  • Loading branch information
johncurrier committed Jun 10, 2005
1 parent e968c33 commit 28487c0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/net/sourceforge/schemaspy/model/TableIndex.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ public class TableIndex implements Comparable, Serializable {
private final Object id;
private final String name;
private final boolean isUnique;
private final String sortOrder;
private boolean isPrimary;
private final List columns = new ArrayList();

public TableIndex(ResultSet rs) throws SQLException {
name = rs.getString("INDEX_NAME");
isUnique = !rs.getBoolean("NON_UNIQUE");
sortOrder = rs.getString("ASC_OR_DESC");
id = null;
}

Expand Down Expand Up @@ -54,6 +56,10 @@ public boolean isUnique() {
return isUnique;
}

public boolean isAscending() {
return sortOrder == null || sortOrder.equals("A");
}

public String getColumnsAsString() {
StringBuffer buf = new StringBuffer();

Expand Down

0 comments on commit 28487c0

Please sign in to comment.