001package gudusoft.gsqlparser.dlineage.dataflow.model.xml; 002 003import gudusoft.gsqlparser.dlineage.dataflow.model.ModelBindingManager; 004import gudusoft.gsqlparser.util.SQLUtil; 005 006import javax.xml.bind.annotation.XmlAttribute; 007import javax.xml.bind.annotation.XmlElement; 008import javax.xml.bind.annotation.XmlTransient; 009import javax.xml.bind.annotation.XmlType; 010import java.util.LinkedList; 011import java.util.List; 012 013@XmlType(propOrder = { "id", "server", "database", "schema", "name", "type", "coordinate", "comment", 014 "displayName", "arguments" }) 015public class procedure { 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 private String comment; 032 033 private String displayName; 034 035 private List<argument> arguments; 036 037 @XmlTransient 038 private oraclePackage oraclePackage; 039 040 /** 041 * The identity a call of this routine meets it under in a merge, from its name as written, taken when the 042 * analysis published it: normalized output renames the routine afterwards, and an XML document drops it. 043 */ 044 @XmlTransient 045 private Object routineKey; 046 047 public procedure() { 048 } 049 050 @XmlAttribute(required = false) 051 public String getCoordinate() { 052 if (ModelBindingManager.getGlobalOption()!=null && ModelBindingManager.getGlobalOption().isIgnoreCoordinate()) { 053 return null; 054 } 055 return this.coordinate; 056 } 057 058 public void setCoordinate(String coordinate) { 059 if (ModelBindingManager.getGlobalOption()!=null && ModelBindingManager.getGlobalOption().isIgnoreCoordinate()) { 060 return; 061 } 062 this.coordinate = coordinate; 063 } 064 065 /** 066 * The comment the author wrote immediately above this procedure, verbatim, or {@code null}. 067 * 068 * <p>Populated only when {@code Option.setShowComment(true)}. Bounded at a blank line, so a 069 * package-level header block stays on the package and does not repeat here. 070 */ 071 @XmlAttribute(required = false) 072 public String getComment() { 073 return this.comment; 074 } 075 076 public void setComment(String comment) { 077 this.comment = comment; 078 } 079 080 /** 081 * A human-facing name for this procedure. GSP never fills this in: naming a procedure 082 * 「销售发货单」 from a comment is a product rule, and inventing one here would put a guess 083 * where callers expect a fact. The field exists so a caller that derives such a name from 084 * {@link #getComment()} can carry it in the same document. 085 */ 086 @XmlAttribute(required = false) 087 public String getDisplayName() { 088 return this.displayName; 089 } 090 091 public void setDisplayName(String displayName) { 092 this.displayName = displayName; 093 } 094 095 @XmlAttribute(required = false) 096 public String getName() { 097 return this.name; 098 } 099 100 public void setName(String name) { 101 this.name = name; 102 } 103 104 @XmlAttribute(required = false) 105 public String getId() { 106 return this.id; 107 } 108 109 public void setId(String id) { 110 this.id = id; 111 } 112 113 @XmlAttribute(required = false) 114 public String getType() { 115 return this.type; 116 } 117 118 public void setType(String type) { 119 this.type = type; 120 } 121 122 @XmlElement(name = "argument", required = false) 123 public List<argument> getArguments() { 124 if (this.arguments == null) { 125 this.arguments = new LinkedList<argument>(); 126 } 127 return this.arguments; 128 } 129 130 public void setArguments(List<argument> arguments) { 131 this.arguments = arguments; 132 } 133 134 @XmlAttribute(required = false) 135 public String getDatabase() { 136 return database; 137 } 138 139 public void setDatabase(String database) { 140 if (SQLUtil.parseNames(database).size() > 1) { 141 database = "\"" + database + "\""; 142 } 143 this.database = database; 144 } 145 146 @XmlAttribute(required = false) 147 public String getSchema() { 148 return schema; 149 } 150 151 public void setSchema(String schema) { 152 if (SQLUtil.parseNames(schema).size() > 1) { 153 schema = "\"" + schema + "\""; 154 } 155 this.schema = schema; 156 } 157 158 @XmlAttribute(required = false) 159 public String getServer() { 160 return server; 161 } 162 163 public void setServer(String server) { 164 this.server = server; 165 } 166 167 @XmlTransient 168 public Object getRoutineKey() { 169 return routineKey; 170 } 171 172 public void setRoutineKey(Object routineKey) { 173 this.routineKey = routineKey; 174 } 175 176 @XmlTransient 177 public oraclePackage getOraclePackage() { 178 return oraclePackage; 179 } 180 181 public void setOraclePackage(gudusoft.gsqlparser.dlineage.dataflow.model.xml.oraclePackage oraclePackage) { 182 this.oraclePackage = oraclePackage; 183 } 184}