1 19 20 package org.netbeans.modules.dbschema.jdbcimpl; 21 22 import org.netbeans.modules.dbschema.*; 23 24 public class ColumnElementImpl extends DBMemberElementImpl implements ColumnElement.Impl { 25 26 protected int _type; 27 protected boolean _isNullable; 28 protected Integer _length; 29 protected Integer _precision; 30 protected Integer _scale; 31 32 33 public ColumnElementImpl() { 34 } 35 36 37 public ColumnElementImpl (String name) { 38 super(name); 39 } 40 41 42 public ColumnElementImpl(String name, String type, String isNullable, String size, String decimal) { 43 super(name); 44 45 _type = new Integer (type).intValue(); 46 int nullable = new Integer (isNullable).intValue(); 47 48 54 if (nullable == 0) 55 _isNullable = false; 57 else 58 _isNullable = true; 60 61 if (size != null) 62 _length = new Integer (size); 63 else 64 _length = null; 65 66 if (size != null) 67 _precision = new Integer (size); 68 else 69 _precision = new Integer (0); 70 71 if (decimal != null) 72 _scale = new Integer (decimal); 73 else 74 _scale = null; 75 } 76 77 80 public int getType() { 81 return _type; 82 } 83 84 88 public void setType(int type) throws DBException { 89 _type = type; 90 } 91 92 95 public boolean isNullable() { 96 return _isNullable; 97 } 98 99 103 public void setNullable(boolean isNullable) throws DBException { 104 _isNullable = isNullable; 105 } 106 107 111 public Integer getLength() { 112 return _length; 113 } 114 115 119 public void setLength(Integer length) throws DBException { 120 _length = length; 121 } 122 123 127 public Integer getPrecision() { 128 return _precision; 129 } 130 131 135 public void setPrecision(Integer precision) throws DBException { 136 _precision = precision; 137 } 138 139 143 public Integer getScale() { 144 return _scale; 145 } 146 147 151 public void setScale(Integer scale) throws DBException { 152 _scale = scale; 153 } 154 } 155 | Popular Tags |