001package gudusoft.gsqlparser.dlineage.metadata;
002
003import gudusoft.gsqlparser.dlineage.dataflow.model.ModelBindingManager;
004
005public class Column extends TreeNode {
006        private String source;
007        private String dataType;
008        private String name;
009        private String comment;
010    private Coordinate[] coordinates;
011
012        private Boolean primaryKey;
013
014        private Boolean unqiueKey;
015
016        private Boolean indexKey;
017
018        private Boolean foreignKey;
019
020        private Boolean nullable;
021
022        private Boolean identity;
023
024        private Boolean computed;
025
026        private Boolean persisted;
027
028        private String computedDefinition;
029
030        private String defaultValue;
031
032        private String defaultName;
033
034        public String getName() {
035                return name;
036        }
037
038        public void setName(String name) {
039                this.name = name;
040        }
041
042        public String getDataType() {
043                return dataType;
044        }
045
046        public void setDataType(String dataType) {
047                this.dataType = dataType;
048        }
049
050        public String getComment() {
051                return comment;
052        }
053
054        public void setComment(String comment) {
055                this.comment = comment;
056        }
057
058        public String getSource() {
059                return source;
060        }
061
062        public void setSource(String source) {
063                this.source = source;
064        }
065
066        public String fullName() {
067                TreeNode parent = getParent();
068                Server server = getServer();
069                if (parent == null || server == null) {
070                        return name;
071                } else {
072                        Table table = (Table) getParent();
073                        return table.fullName() + "." + name;
074                }
075        }
076        
077        public Coordinate[] getCoordinates() {
078                if (ModelBindingManager.getGlobalOption()!=null && ModelBindingManager.getGlobalOption().isIgnoreCoordinate()) {
079                        return null;
080                }
081                return coordinates;
082        }
083
084        public void setCoordinates(Coordinate[] coordinates) {
085                if (ModelBindingManager.getGlobalOption()!=null && ModelBindingManager.getGlobalOption().isIgnoreCoordinate()) {
086                        return;
087                }
088                this.coordinates = coordinates;
089        }
090
091        public Boolean isPrimaryKey() {
092                return primaryKey;
093        }
094
095        public void setPrimaryKey(Boolean primaryKey) {
096                this.primaryKey = primaryKey;
097        }
098
099        public Boolean isUnqiueKey() {
100                return unqiueKey;
101        }
102
103        public void setUnqiueKey(Boolean unqiueKey) {
104                this.unqiueKey = unqiueKey;
105        }
106
107        public Boolean isIndexKey() {
108                return indexKey;
109        }
110
111        public void setIndexKey(Boolean indexKey) {
112                this.indexKey = indexKey;
113        }
114
115        public Boolean isForeignKey() {
116                return foreignKey;
117        }
118
119        public void setForeignKey(Boolean foreignKey) {
120                this.foreignKey = foreignKey;
121        }
122
123        public Boolean isNullable() {
124                return nullable;
125        }
126
127        public void setNullable(Boolean nullable) {
128                this.nullable = nullable;
129        }
130
131        public Boolean isIdentity() {
132                return identity;
133        }
134
135        public void setIdentity(Boolean identity) {
136                this.identity = identity;
137        }
138
139        public Boolean isComputed() {
140                return computed;
141        }
142
143        public void setComputed(Boolean computed) {
144                this.computed = computed;
145        }
146
147        public Boolean isPersisted() {
148                return persisted;
149        }
150
151        public void setPersisted(Boolean persisted) {
152                this.persisted = persisted;
153        }
154
155        public String getComputedDefinition() {
156                return computedDefinition;
157        }
158
159        public void setComputedDefinition(String computedDefinition) {
160                this.computedDefinition = computedDefinition;
161        }
162
163        public String getDefaultValue() {
164                return defaultValue;
165        }
166
167        public void setDefaultValue(String defaultValue) {
168                this.defaultValue = defaultValue;
169        }
170
171        public String getDefaultName() {
172                return defaultName;
173        }
174
175        public void setDefaultName(String defaultName) {
176                this.defaultName = defaultName;
177        }
178}