1 package org.hibernate.tool.hbm2ddl; 3 4 import java.sql.ResultSet ; 5 import java.sql.SQLException ; 6 import java.util.ArrayList ; 7 import java.util.List ; 8 9 13 public class ForeignKeyMetadata { 14 private final String name; 15 private final List columns = new ArrayList (); 16 17 ForeignKeyMetadata(ResultSet rs) throws SQLException { 18 name = rs.getString("FK_NAME"); 19 } 20 21 public String getName() { 22 return name; 23 } 24 25 void addColumn(ColumnMetadata column) { 26 if (column != null) columns.add(column); 27 } 28 29 public ColumnMetadata[] getColumns() { 30 return (ColumnMetadata[]) columns.toArray(new ColumnMetadata[0]); 31 } 32 33 public String toString() { 34 return "ForeignKeyMetadata(" + name + ')'; 35 } 36 } 37 38 39 40 41 42 43 | Popular Tags |