001package gudusoft.gsqlparser.dlineage.dataflow.model;
002
003import java.util.ArrayList;
004import java.util.List;
005
006public class RelationRows<T> {
007
008        protected long id;
009
010        private T holder;
011
012        private List<Relationship> relations = new ArrayList<Relationship>();
013        
014        private boolean hasRelation = false;
015
016        public RelationRows(T holder) {
017                this.holder = holder;
018                id = ++ModelBindingManager.get().TABLE_COLUMN_ID;
019        }
020
021        public T getHolder() {
022                return holder;
023        }
024
025        public String getName() {
026                return "RelationRows";
027        }
028
029        public long getId() {
030                return id;
031        }
032
033        public void holdRelation(Relationship relation) {
034                if (relation != null) {
035                        relations.add(relation);
036                }
037        }
038        
039        public List<Relationship> getHoldRelations(){
040                return relations;
041        }
042
043        public boolean hasRelation() {
044                return hasRelation;
045        }
046
047        public void setHasRelation(boolean hasRelation) {
048                this.hasRelation = hasRelation;
049        }
050}