1    package com.instantbank.component.job.util;
2    
3    import java.io.Serializable;
4    
5    /**
6     *  In memory representation of a system alias
7     *  (corresponding to table :
8     *   com.instantbank.common.utilcomponents.DatabaseNames.LETT_ALIAS)
9     *
10    * @author InstantBank (Consuelo Franky)
11    * @created October 2002
12    */
13   public class Alias
14       implements Serializable {
15     /**
16      * name of table alias
17      */
18     private String tableAlias;
19     /**
20      * root type for joins: LetterTemplateGlobals.ROOT_AGREEMENTS
21      */
22     private String rootType;
23     /**
24      * description of tableAlias
25      */
26     private String description;
27     /**
28      * name of real table associated to tableAlias
29      */
30     private String realTable;
31   
32     /**
33      * category of fields associated to tableAlias :
34      *LetterTemplateGlobals.NORMAL_FIELDS, TEMPORAL_FIELDS, DERIVED_FIELDS
35      */
36     private String fieldCategory;
37   
38     /**
39      * alias of parent table for join;
40      *it is optional
41      */
42     private String parentTableAlias;
43   
44     /**
45      * column name in parent table for join;
46      *it is optional
47      */
48     private String parentJoinColumn;
49   
50     /**
51      * column name in son table (i.e. tableAlias) for join;
52      *it is optional
53      */
54     private String sonJoinColumn;
55   
56     /**
57      * type of join :
58      *LetterTemplateGlobals.SIMPLE_JOIN, OUTER_JOIN;
59      *it is optional
60      */
61     private String joinType;
62   
63     /**
64      * sql text for building a temporal table when fieldCategory is
65      *LetterTemplateGlobals.TEMPORAL_FIELDS;
66      *it is optional
67      */
68     private String builtTable;
69   
70   
71     /**
72      *  Constructor for the Alias object
73      *
74      * @param tableAlias name of table alias
75      * @param rootType root type for joins
76      * @param description description of tableAlias
77      * @param realTable name of real table associated to tableAlias
78      * @param fieldCategory category of fields associated to tableAlias
79      * @param parentTableAlias alias of parent table for join
80      * @param parentJoinColumn column name in parent table for join
81      * @param sonJoinColumn column name in son table for join
82      * @param joinType type of join
83      * @param builtTable sql text for building a temporal table
84      */
85     public Alias(String tableAlias, String rootType, String description,
86                  String realTable, String fieldCategory, String parentTableAlias,
87                  String parentJoinColumn, String sonJoinColumn, String joinType,
88                  String builtTable) {
89       this.tableAlias = tableAlias;
90       this.rootType = rootType;
91       this.description = description;
92       this.realTable = realTable;
93       this.fieldCategory = fieldCategory;
94       this.parentTableAlias = parentTableAlias;
95       this.parentJoinColumn = parentJoinColumn;
96       this.sonJoinColumn = sonJoinColumn;
97       this.joinType = joinType;
98       this.builtTable = builtTable;
99     }
100  
101    // GETTER METHODS :
102  
103    /**
104     *  Gets the tableAlias attribute of the Alias object
105     *
106     * @return The tableAlias value
107     */
108    public String getTableAlias() {
109      return (this.tableAlias);
110    }
111  
112  
113    /**
114     *  Gets the rootType attribute of the Alias object
115     *
116     * @return The rootType value
117     */
118    public String getRootType() {
119      return (this.rootType);
120    }
121  
122  
123    /**
124     *  Gets the description attribute of the Alias object
125     *
126     * @return The description value
127     */
128    public String getDescription() {
129      return (this.description);
130    }
131  
132  
133    /**
134     *  Gets the realTable attribute of the Alias object
135     *
136     * @return The realTable value
137     */
138    public String getRealTable() {
139      return (this.realTable);
140    }
141  
142  
143    /**
144     *  Gets the fieldCategory attribute of the Alias object
145     *
146     * @return The fieldCategory value
147     */
148    public String getFieldCategory() {
149      return (this.fieldCategory);
150    }
151  
152  
153    /**
154     *  Gets the parentTableAlias attribute of the Alias object
155     *
156     * @return The parentTableAlias value
157     */
158    public String getParentTableAlias() {
159      return (this.parentTableAlias);
160    }
161  
162  
163    /**
164     *  Gets the parentJoinColumn attribute of the Alias object
165     *
166     * @return The parentJoinColumn value
167     */
168    public String getParentJoinColumn() {
169      return (this.parentJoinColumn);
170    }
171  
172  
173    /**
174     *  Gets the sonJoinColumn attribute of the Alias object
175     *
176     * @return The sonJoinColumn value
177     */
178    public String getSonJoinColumn() {
179      return (this.sonJoinColumn);
180    }
181  
182  
183    /**
184     *  Gets the joinType attribute of the Alias object
185     *
186     * @return The joinType value
187     */
188    public String getJoinType() {
189      return (this.joinType);
190    }
191  
192  
193    /**
194     *  Gets the builtTable attribute of the Alias object
195     *
196     * @return The builtTable value
197     */
198    public String getBuiltTable() {
199      return (this.builtTable);
200    }
201  
202    // OTHER METHODS :
203  
204    /**
205     *  Textual representation of the Alias object
206     *
207     * @return text of the Alias object
208     */
209    public String toString() {
210  
211      StringBuffer toString = new StringBuffer();
212      toString.append("\ntableAlias = ");
213      toString.append(tableAlias);
214      toString.append("\nrootType = ");
215      toString.append(rootType);
216      toString.append("\ndescription = ");
217      toString.append(description);
218      toString.append("\nrealTable = ");
219      toString.append(realTable);
220      toString.append("\nfieldCategory = ");
221      toString.append(fieldCategory);
222      toString.append("\nparentTableAlias = ");
223      toString.append(parentTableAlias);
224      toString.append("\nparentJoinColumn = ");
225      toString.append(parentJoinColumn);
226      toString.append("\nsonJoinColumn = ");
227      toString.append(sonJoinColumn);
228      toString.append("\njoinType = ");
229      toString.append(joinType);
230      toString.append("\nbuiltTable = ");
231      toString.append(builtTable);
232      toString.append("\n");
233  
234      return new String(toString);
235    }
236  
237  }
238