001package gudusoft.gsqlparser.dlineage.dataflow.model.xml;
002
003import java.util.ArrayList;
004import java.util.List;
005
006import javax.xml.bind.annotation.XmlAttribute;
007import javax.xml.bind.annotation.XmlElement;
008import javax.xml.bind.annotation.XmlType;
009
010import gudusoft.gsqlparser.dlineage.dataflow.model.ModelBindingManager;
011import gudusoft.gsqlparser.util.SQLUtil;
012
013@XmlType(propOrder = { "id", "server", "database", "schema", "name", "type", "coordinate", "comment",
014                "arguments", "procedures" })
015public class oraclePackage {
016
017        private String id;
018        
019        private String server;
020
021        private String database;
022
023        private String schema;
024
025        private String name;
026
027        private String type;
028
029        private String coordinate;
030
031        
032
033        private String comment;
034
035        private List<argument> arguments;
036        
037        private List<procedure> procedures;
038
039        public oraclePackage() {
040        }
041
042        @XmlAttribute(required = false)
043        public String getCoordinate() {
044                if (ModelBindingManager.getGlobalOption()!=null && ModelBindingManager.getGlobalOption().isIgnoreCoordinate()) {
045                        return null;
046                }
047                return this.coordinate;
048        }
049
050        public void setCoordinate(String coordinate) {
051                if (ModelBindingManager.getGlobalOption()!=null && ModelBindingManager.getGlobalOption().isIgnoreCoordinate()) {
052                        return;
053                }
054                this.coordinate = coordinate;
055        }
056
057        /**
058
059         * The header comment of this package body, verbatim, or {@code null}.
060
061         *
062
063         * <p>Populated only when {@code Option.setShowComment(true)}. This is the block that sits
064
065         * under the package declaration and is separated from the first procedure by a blank line;
066
067         * it describes the package, so it belongs here rather than on that procedure.
068
069         */
070
071        @XmlAttribute(required = false)
072
073        public String getComment() {
074
075                return this.comment;
076
077        }
078
079
080        public void setComment(String comment) {
081
082                this.comment = comment;
083
084        }
085
086
087        @XmlAttribute(required = false)
088        public String getName() {
089                return this.name;
090        }
091
092        public void setName(String name) {
093                this.name = name;
094        }
095
096        @XmlAttribute(required = false)
097        public String getId() {
098                return this.id;
099        }
100
101        public void setId(String id) {
102                this.id = id;
103        }
104
105        @XmlAttribute(required = false)
106        public String getType() {
107                return this.type;
108        }
109
110        public void setType(String type) {
111                this.type = type;
112        }
113
114        @XmlElement(name = "procedure", required = false)
115        public List<procedure> getProcedures() {
116                if (this.procedures == null) {
117                        this.procedures = new ArrayList<procedure>();
118                }
119                return this.procedures;
120        }
121
122        public void setProcedures(List<procedure> procedures) {
123                this.procedures = procedures;
124        }
125        
126        @XmlElement(name = "argument", required = false)
127        public List<argument> getArguments() {
128                if (this.arguments == null) {
129                        this.arguments = new ArrayList<argument>();
130                }
131                return this.arguments;
132        }
133
134        public void setArguments(List<argument> arguments) {
135                this.arguments = arguments;
136        }
137
138        @XmlAttribute(required = false)
139        public String getDatabase() {
140                return database;
141        }
142
143        public void setDatabase(String database) {
144                if (SQLUtil.parseNames(database).size() > 1) {
145                        database = "\"" + database + "\"";
146                }
147                this.database = database;
148        }
149
150        @XmlAttribute(required = false)
151        public String getSchema() {
152                return schema;
153        }
154
155        public void setSchema(String schema) {
156                if (SQLUtil.parseNames(schema).size() > 1) {
157                        schema = "\"" + schema + "\"";
158                }
159                this.schema = schema;
160        }
161
162        @XmlAttribute(required = false)
163        public String getServer() {
164                return server;
165        }
166
167        public void setServer(String server) {
168                this.server = server;
169        }
170}