123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270 |
- package com.sysmodel.datamodel.xmlmodel.impl;
- import com.sysmodel.datamodel.xmlmodel.Reference;
- import com.sysmodel.datamodel.xmlmodel.able.MdpAttribute;
- public class MdpAttributeImpl implements MdpAttribute{
- private boolean validate;
- private String name;
- private String ngoogleEn;
- private String oldName;
- private String description;
- private String unit;
- private boolean logicPrimaryKey;
- private String dataType;
- private int referenceType;
- private String scale;
- private int precision;
- private boolean index;
- private String indexType = null;
- private String defaultValue = null;
- private boolean notNull = false;
- private Reference reference = null;
- private boolean isAutoIncrement;
- private boolean isReadOnly;
- private boolean isSearchable;
- private boolean isSigned;
- private int columnDisplaySize;
- private String fieldType;
- public String getDataType() {
- return dataType;
- }
- public void setDataType(String dataType) {
- this.dataType = dataType;
- }
- public String getDescription() {
- return description;
- }
- public void setDescription(String description) {
- this.description = description;
- }
- public boolean isIndex() {
- return index;
- }
- public void setIndex(boolean index) {
- this.index = index;
- }
- public boolean isLogicPrimaryKey() {
- return logicPrimaryKey;
- }
- public void setLogicPrimaryKey(boolean logicPrimaryKey) {
- this.logicPrimaryKey = logicPrimaryKey;
- }
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- public int getPrecision() {
- return precision;
- }
- public void setPrecision(int precision) {
- this.precision = precision;
- }
- public Reference getReference() {
- return reference;
- }
- public void setReference(Reference reference) {
- this.reference = reference;
- }
- public int getReferenceType() {
- return referenceType;
- }
- public void setReferenceType(int referenceType) {
- this.referenceType = referenceType;
- }
- public String getScale() {
- return scale;
- }
- public void setScale(String scale) {
- this.scale = scale;
- }
- public boolean isValidate() {
- return validate;
- }
- public void setValidate(boolean validate) {
- this.validate = validate;
- }
- public String getDefaultValue() {
- return defaultValue;
- }
- public void setDefaultValue(String defaultValue) {
- this.defaultValue = defaultValue;
- }
- public String getIndexType() {
- return indexType;
- }
- public void setIndexType(String indexType) {
- this.indexType = indexType;
- }
- public boolean isNotNull() {
- return notNull;
- }
- public void setNotNull(boolean notNull) {
- this.notNull = notNull;
- }
- public String getUnit() {
- return unit;
- }
- public void setUnit(String unit) {
- this.unit = unit;
- }
- public boolean equals(Object obj) {
- if (obj instanceof MdpClassImpl) {
- MdpAttributeImpl temp = (MdpAttributeImpl) obj;
- if (temp.name.equals(this.name))
- return true;
- }
- return false;
- }
- public String getFieldDefine() {
- StringBuffer sb = new StringBuffer();
- sb.append("XML中定义 中文名:" + this.description + " 英文名:" + this.name + " ");
- if (this.getDataType().equals("date")) {
- sb.append("数据类型: date" + " 日期格式:" + this.getScale());
- } else if (this.getDataType().equals("string")) {
- sb.append("数据类型: string" + " 最大长度: " + this.getPrecision());
- } else if (this.getDataType().equals("number")) {
- sb.append("数据类型: number" + " 最大长度: " + this.getPrecision() + " 小数位: " + this.getScale());
- } else if (this.getDataType().equals("blob")) {
- sb.append("数据类型: blob");
- } else if (this.getDataType().equals("clob")) {
- sb.append("数据类型: clob");
- }
- if (this.referenceType != 0) {
- if (this.reference != null) {
- sb.append(" 引用类型:" + this.referenceType);
- if (this.referenceType == 1) {
- sb.append(" 引用表编号 :");
- sb.append(this.reference.getReferenceTable());
- sb.append(" 引用字段:" + this.reference.getStoreName());
- sb.append(" 展示字段" + this.reference.getDisplayName());
- }
- if (this.referenceType == 2) {
- sb.append(" 引用常量 :");
- sb.append(this.reference.getReferenceTable());
- }
- }
- }
- return sb.toString();
- }
- public String toString() {
- return description;
- }
- public String getOldName() {
- return oldName;
- }
- public void setOldName(String oldName) {
- this.oldName = oldName;
- }
- public String getNgoogleEn() {
- return ngoogleEn;
- }
- public void setNgoogleEn(String ngoogleEn) {
- this.ngoogleEn = ngoogleEn;
- }
- public boolean isAutoIncrement() {
- return isAutoIncrement;
- }
- public void setAutoIncrement(boolean isAutoIncrement) {
- this.isAutoIncrement = isAutoIncrement;
- }
- public boolean isReadOnly() {
- return isReadOnly;
- }
- public void setReadOnly(boolean isReadOnly) {
- this.isReadOnly = isReadOnly;
- }
- public boolean isSearchable() {
- return isSearchable;
- }
- public void setSearchable(boolean isSearchable) {
- this.isSearchable = isSearchable;
- }
- public boolean isSigned() {
- return isSigned;
- }
- public void setSigned(boolean isSigned) {
- this.isSigned = isSigned;
- }
- public int getColumnDisplaySize() {
- return columnDisplaySize;
- }
- public void setColumnDisplaySize(int columnDisplaySize) {
- this.columnDisplaySize = columnDisplaySize;
- }
- public String getFieldType() {
- return fieldType;
- }
- public void setFieldType(String fieldType) {
- this.fieldType = fieldType;
- }
- }
|