/build.properties/src/com/framedobjects/dashwell/db/meta/MetaField.java

http://mobiledatanow.googlecode.com/ · Java · 249 lines · 123 code · 33 blank · 93 comment · 9 complexity · f3f63d1ad4c8fd0c72262fb6b165fa0f MD5 · raw file

  1. package com.framedobjects.dashwell.db.meta;
  2. /**
  3. * @author Jens Richnow
  4. *
  5. */
  6. public class MetaField {
  7. public static final String TYPE_CURRENCY = "Currency";
  8. public static final String TYPE_DATE_TIME = "DateTime";
  9. public static final String TYPE_DECIMAL = "Decimal";
  10. public static final String TYPE_INTEGER = "Integer";
  11. public static final String TYPE_STRING = "String";
  12. public static final String TYPE_UNKNOWN = "Unknown";
  13. private int fieldID = 0;
  14. private int tableID = 0;
  15. private int connectionID = 0;
  16. private String qualifiedName = null;
  17. private String tableName = null;
  18. private String name = null;
  19. private int fieldType = 0;
  20. private String type = null;
  21. private String nativeType = "";
  22. private String size = null; // column_size.
  23. private int decimalDigits = 0;
  24. private String readOnly = null;
  25. private String uniqueKey = null;
  26. private String description = null;
  27. public MetaField(){
  28. }
  29. public MetaField(int fieldID, int tableID, String name, int fieldType,
  30. String nativeType, String description, int columnSize, int decimalDigits){
  31. this.fieldID = fieldID;
  32. this.tableID = tableID;
  33. this.name = name;
  34. this.fieldType = fieldType;
  35. this.nativeType = nativeType;
  36. this.description = description;
  37. this.size = String.valueOf(columnSize);
  38. this.decimalDigits = decimalDigits;
  39. }
  40. /**
  41. * @return Returns the description.
  42. */
  43. public String getDescription() {
  44. return description == null ? "" : description;
  45. }
  46. /**
  47. * @param description
  48. * The description to set.
  49. */
  50. public void setDescription(String description) {
  51. this.description = description;
  52. }
  53. /**
  54. * @return Returns the name.
  55. */
  56. public String getName() {
  57. return name;
  58. }
  59. /**
  60. * @param name
  61. * The name to set.
  62. */
  63. public void setName(String name) {
  64. this.name = name;
  65. }
  66. /**
  67. * @return Returns the primaryKey.
  68. */
  69. public String getUniqueKey() {
  70. return uniqueKey == null ? "" : uniqueKey;
  71. }
  72. /**
  73. * @param primaryKey
  74. * The primaryKey to set.
  75. */
  76. public void setUniqueKey(String primaryKey) {
  77. this.uniqueKey = primaryKey;
  78. }
  79. /**
  80. * @return Returns the readOnly.
  81. */
  82. public String getReadOnly() {
  83. return readOnly == null ? "" : readOnly;
  84. }
  85. /**
  86. * @param readOnly
  87. * The readOnly to set.
  88. */
  89. public void setReadOnly(String readOnly) {
  90. this.readOnly = readOnly;
  91. }
  92. /**
  93. * @return Returns the size.
  94. */
  95. public String getSize() {
  96. return size == null ? "" : size;
  97. }
  98. /**
  99. * @param size
  100. * The size to set.
  101. */
  102. public void setSize(String size) {
  103. this.size = size;
  104. }
  105. /**
  106. * @return Returns the type.
  107. */
  108. public String getType() {
  109. return type == null ? "" : type;
  110. }
  111. /**
  112. * @param type
  113. * The type to set.
  114. */
  115. public void setType(String type) {
  116. this.type = type;
  117. }
  118. public int getDecimalDigits() {
  119. return decimalDigits;
  120. }
  121. public void setDecimalDigits(int decimalDigits) {
  122. this.decimalDigits = decimalDigits;
  123. }
  124. /**
  125. * @return Returns the nativeSize.
  126. */
  127. public String getNativeType() {
  128. return nativeType == null ? "" : nativeType;
  129. }
  130. /**
  131. * @param nativeSize
  132. * The nativeSize to set.
  133. */
  134. public void setNativeType(String nativeSize) {
  135. this.nativeType = nativeSize;
  136. }
  137. /**
  138. * @return Returns the connectionID.
  139. */
  140. public int getConnectionID() {
  141. return connectionID;
  142. }
  143. /**
  144. * @param connectionID
  145. * The connectionID to set.
  146. */
  147. public void setConnectionID(int connectionID) {
  148. this.connectionID = connectionID;
  149. }
  150. /**
  151. * @return Returns the fieldID.
  152. */
  153. public int getFieldID() {
  154. return fieldID;
  155. }
  156. /**
  157. * @param fieldID
  158. * The fieldID to set.
  159. */
  160. public void setFieldID(int fieldID) {
  161. this.fieldID = fieldID;
  162. }
  163. /**
  164. * @return Returns the tableID.
  165. */
  166. public int getTableID() {
  167. return tableID;
  168. }
  169. /**
  170. * @param tableID
  171. * The tableID to set.
  172. */
  173. public void setTableID(int tableID) {
  174. this.tableID = tableID;
  175. }
  176. /**
  177. * @return Returns the fieldType.
  178. */
  179. public int getFieldType() {
  180. return fieldType;
  181. }
  182. /**
  183. * @param fieldType
  184. * The fieldType to set.
  185. */
  186. public void setFieldType(int fieldType) {
  187. this.fieldType = fieldType;
  188. }
  189. /**
  190. * @return Returns the qualifiedName.
  191. */
  192. public String getQualifiedName() {
  193. if (qualifiedName == null){
  194. qualifiedName = tableName + "." + name;
  195. }
  196. return qualifiedName;
  197. }
  198. /**
  199. * @param qualifiedName The qualifiedName to set.
  200. */
  201. public void setQualifiedName(String qualifiedName) {
  202. this.qualifiedName = qualifiedName;
  203. }
  204. /**
  205. * @return Returns the tableName.
  206. */
  207. public String getTableName() {
  208. return tableName == null ? "" : tableName;
  209. }
  210. /**
  211. * @param tableName The tableName to set.
  212. */
  213. public void setTableName(String tableName) {
  214. this.tableName = tableName;
  215. }
  216. }