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        public String getName() {
021                return name;
022        }
023
024        public void setName(String name) {
025                this.name = name;
026        }
027
028        public String getDataType() {
029                return dataType;
030        }
031
032        public void setDataType(String dataType) {
033                this.dataType = dataType;
034        }
035
036        public String getComment() {
037                return comment;
038        }
039
040        public void setComment(String comment) {
041                this.comment = comment;
042        }
043
044        public String getSource() {
045                return source;
046        }
047
048        public void setSource(String source) {
049                this.source = source;
050        }
051
052        public String fullName() {
053                TreeNode parent = getParent();
054                Server server = getServer();
055                if (parent == null || server == null) {
056                        return name;
057                } else {
058                        Table table = (Table) getParent();
059                        return table.fullName() + "." + name;
060                }
061        }
062        
063        public Coordinate[] getCoordinates() {
064                if (ModelBindingManager.getGlobalOption()!=null && ModelBindingManager.getGlobalOption().isIgnoreCoordinate()) {
065                        return null;
066                }
067                return coordinates;
068        }
069
070        public void setCoordinates(Coordinate[] coordinates) {
071                if (ModelBindingManager.getGlobalOption()!=null && ModelBindingManager.getGlobalOption().isIgnoreCoordinate()) {
072                        return;
073                }
074                this.coordinates = coordinates;
075        }
076
077        public Boolean isPrimaryKey() {
078                return primaryKey;
079        }
080
081        public void setPrimaryKey(Boolean primaryKey) {
082                this.primaryKey = primaryKey;
083        }
084
085        public Boolean isUnqiueKey() {
086                return unqiueKey;
087        }
088
089        public void setUnqiueKey(Boolean unqiueKey) {
090                this.unqiueKey = unqiueKey;
091        }
092
093        public Boolean isIndexKey() {
094                return indexKey;
095        }
096
097        public void setIndexKey(Boolean indexKey) {
098                this.indexKey = indexKey;
099        }
100
101        public Boolean isForeignKey() {
102                return foreignKey;
103        }
104
105        public void setForeignKey(Boolean foreignKey) {
106                this.foreignKey = foreignKey;
107        }
108}