01: //$Id: IndexMetadata.java 4279 2004-08-13 08:05:47Z oneovthafew $
02: package org.hibernate.tool.hbm2ddl;
03:
04: import java.sql.ResultSet;
05: import java.sql.SQLException;
06: import java.util.ArrayList;
07: import java.util.List;
08:
09: /**
10: * JDBC index metadata
11: * @author Christoph Sturm
12: */
13: public class IndexMetadata {
14: private final String name;
15: private final List columns = new ArrayList();
16:
17: IndexMetadata(ResultSet rs) throws SQLException {
18: name = rs.getString("INDEX_NAME");
19: }
20:
21: public String getName() {
22: return name;
23: }
24:
25: void addColumn(ColumnMetadata column) {
26: if (column != null)
27: columns.add(column);
28: }
29:
30: public ColumnMetadata[] getColumns() {
31: return (ColumnMetadata[]) columns
32: .toArray(new ColumnMetadata[0]);
33: }
34:
35: public String toString() {
36: return "IndexMatadata(" + name + ')';
37: }
38: }
|