1 package org.hibernate.tool.hbm2ddl; 3 4 import java.sql.ResultSet ; 5 import java.sql.SQLException ; 6 7 11 public class ColumnMetadata { 12 private final String name; 13 private final String typeName; 14 private final int columnSize; 15 private final int decimalDigits; 16 private final String isNullable; 17 18 ColumnMetadata(ResultSet rs) throws SQLException { 19 name = rs.getString("COLUMN_NAME"); 20 typeName = rs.getString("TYPE_NAME"); 21 columnSize = rs.getInt("COLUMN_SIZE"); 22 decimalDigits = rs.getInt("DECIMAL_DIGITS"); 23 isNullable = rs.getString("IS_NULLABLE"); 24 } 25 26 public String getName() { 27 return name; 28 } 29 30 public String getTypeName() { 31 return typeName; 32 } 33 34 public int getColumnSize() { 35 return columnSize; 36 } 37 38 public int getDecimalDigits() { 39 return decimalDigits; 40 } 41 42 public String getNullable() { 43 return isNullable; 44 } 45 46 public String toString() { 47 return "ColumnMetadata(" + name + ')'; 48 } 49 50 } 51 52 53 54 55 56 57 | Popular Tags |