001: //The Salmon Open Framework for Internet Applications (SOFIA)
002: //Copyright (C) 1999 - 2002, Salmon LLC
003: //
004: //This program is free software; you can redistribute it and/or
005: //modify it under the terms of the GNU General Public License version 2
006: //as published by the Free Software Foundation;
007: //
008: //This program is distributed in the hope that it will be useful,
009: //but WITHOUT ANY WARRANTY; without even the implied warranty of
010: //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
011: //GNU General Public License for more details.
012: //
013: //You should have received a copy of the GNU General Public License
014: //along with this program; if not, write to the Free Software
015: //Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
016: //
017: //For more information please visit http://www.salmonllc.com
018: package com.salmonllc.examples.example20;
019:
020: import com.salmonllc.sql.*;
021:
022: //$CUSTOMIMPORTS$
023: //Put custom imports between these comments, otherwise they will be overwritten if the model is regenerated
024:
025: //$ENDCUSTOMIMPORTS$
026:
027: /**
028: * ExampleSourceCodeModel: A SOFIA generated model
029: */
030: public class ExampleSourceCodeModel extends DataStore {
031:
032: //constants for columns
033: public static final String EXAMPLES_EXAMPLE_ID = "examples.example_id";
034: public static final String EXAMPLES_NAME = "examples.name";
035: public static final String EXAMPLES_EXPLANATION = "examples.explanation";
036: public static final String EXAMPLES_PAGE_URL = "examples.page_url";
037: public static final String SOURCE_CODE_EXAMPLE_ID = "source_code.example_id";
038: public static final String SOURCE_CODE_FILENAME = "source_code.filename";
039: public static final String SOURCE_CODE_DESCRIPTION = "source_code.description";
040:
041: //$CUSTOMVARS$
042: //Put custom instance variables between these comments, otherwise they will be overwritten if the model is regenerated
043:
044: //$ENDCUSTOMVARS$
045:
046: /**
047: * Create a new ExampleSourceCodeModel object.
048: * @param appName The SOFIA application name
049: */
050: public ExampleSourceCodeModel(String appName) {
051: this (appName, null);
052: }
053:
054: /**
055: * Create a new ExampleSourceCodeModel object.
056: * @param appName The SOFIA application name
057: * @param profile The database profile to use
058: */
059: public ExampleSourceCodeModel(String appName, String profile) {
060: super (appName, profile);
061:
062: //add columns
063: addColumn(computeTableName("examples"), "example_id",
064: DataStore.DATATYPE_INT, true, true, EXAMPLES_EXAMPLE_ID);
065: addColumn(computeTableName("examples"), "name",
066: DataStore.DATATYPE_STRING, false, true, EXAMPLES_NAME);
067: addColumn(computeTableName("examples"), "explanation",
068: DataStore.DATATYPE_STRING, false, true,
069: EXAMPLES_EXPLANATION);
070: addColumn(computeTableName("examples"), "page_url",
071: DataStore.DATATYPE_STRING, false, true,
072: EXAMPLES_PAGE_URL);
073: addColumn(computeTableName("source_code"), "example_id",
074: DataStore.DATATYPE_INT, true, true,
075: SOURCE_CODE_EXAMPLE_ID);
076: addColumn(computeTableName("source_code"), "filename",
077: DataStore.DATATYPE_STRING, true, true,
078: SOURCE_CODE_FILENAME);
079: addColumn(computeTableName("source_code"), "description",
080: DataStore.DATATYPE_STRING, false, true,
081: SOURCE_CODE_DESCRIPTION);
082:
083: //add joins
084: addJoin(computeTableAndFieldName("examples.example_id"),
085: computeTableAndFieldName("source_code.example_id"),
086: false);
087:
088: //$CUSTOMCONSTRUCTOR$
089: //Put custom constructor code between these comments, otherwise it be overwritten if the model is regenerated
090:
091: //$ENDCUSTOMCONSTRUCTOR$
092:
093: }
094:
095: /**
096: * Retrieve the value of the examples.example_id column for the current row.
097: * @return int
098: * @throws DataStoreException
099: */
100: public int getExamplesExampleId() throws DataStoreException {
101: return getInt(EXAMPLES_EXAMPLE_ID);
102: }
103:
104: /**
105: * Retrieve the value of the examples.example_id column for the specified row.
106: * @param row which row in the table
107: * @return int
108: * @throws DataStoreException
109: */
110: public int getExamplesExampleId(int row) throws DataStoreException {
111: return getInt(row, EXAMPLES_EXAMPLE_ID);
112: }
113:
114: /**
115: * Set the value of the examples.example_id column for the current row.
116: * @param newValue the new item value
117: * @throws DataStoreException
118: */
119: public void setExamplesExampleId(int newValue)
120: throws DataStoreException {
121: setInt(EXAMPLES_EXAMPLE_ID, newValue);
122: }
123:
124: /**
125: * Set the value of the examples.example_id column for the specified row.
126: * @param row which row in the table
127: * @param newValue the new item value
128: * @throws DataStoreException
129: */
130: public void setExamplesExampleId(int row, int newValue)
131: throws DataStoreException {
132: setInt(row, EXAMPLES_EXAMPLE_ID, newValue);
133: }
134:
135: /**
136: * Retrieve the value of the examples.name column for the current row.
137: * @return String
138: * @throws DataStoreException
139: */
140: public String getExamplesName() throws DataStoreException {
141: return getString(EXAMPLES_NAME);
142: }
143:
144: /**
145: * Retrieve the value of the examples.name column for the specified row.
146: * @param row which row in the table
147: * @return String
148: * @throws DataStoreException
149: */
150: public String getExamplesName(int row) throws DataStoreException {
151: return getString(row, EXAMPLES_NAME);
152: }
153:
154: /**
155: * Set the value of the examples.name column for the current row.
156: * @param newValue the new item value
157: * @throws DataStoreException
158: */
159: public void setExamplesName(String newValue)
160: throws DataStoreException {
161: setString(EXAMPLES_NAME, newValue);
162: }
163:
164: /**
165: * Set the value of the examples.name column for the specified row.
166: * @param row which row in the table
167: * @param newValue the new item value
168: * @throws DataStoreException
169: */
170: public void setExamplesName(int row, String newValue)
171: throws DataStoreException {
172: setString(row, EXAMPLES_NAME, newValue);
173: }
174:
175: /**
176: * Retrieve the value of the examples.explanation column for the current row.
177: * @return String
178: * @throws DataStoreException
179: */
180: public String getExamplesExplanation() throws DataStoreException {
181: return getString(EXAMPLES_EXPLANATION);
182: }
183:
184: /**
185: * Retrieve the value of the examples.explanation column for the specified row.
186: * @param row which row in the table
187: * @return String
188: * @throws DataStoreException
189: */
190: public String getExamplesExplanation(int row)
191: throws DataStoreException {
192: return getString(row, EXAMPLES_EXPLANATION);
193: }
194:
195: /**
196: * Set the value of the examples.explanation column for the current row.
197: * @param newValue the new item value
198: * @throws DataStoreException
199: */
200: public void setExamplesExplanation(String newValue)
201: throws DataStoreException {
202: setString(EXAMPLES_EXPLANATION, newValue);
203: }
204:
205: /**
206: * Set the value of the examples.explanation column for the specified row.
207: * @param row which row in the table
208: * @param newValue the new item value
209: * @throws DataStoreException
210: */
211: public void setExamplesExplanation(int row, String newValue)
212: throws DataStoreException {
213: setString(row, EXAMPLES_EXPLANATION, newValue);
214: }
215:
216: /**
217: * Retrieve the value of the examples.page_url column for the current row.
218: * @return String
219: * @throws DataStoreException
220: */
221: public String getExamplesPageUrl() throws DataStoreException {
222: return getString(EXAMPLES_PAGE_URL);
223: }
224:
225: /**
226: * Retrieve the value of the examples.page_url column for the specified row.
227: * @param row which row in the table
228: * @return String
229: * @throws DataStoreException
230: */
231: public String getExamplesPageUrl(int row) throws DataStoreException {
232: return getString(row, EXAMPLES_PAGE_URL);
233: }
234:
235: /**
236: * Set the value of the examples.page_url column for the current row.
237: * @param newValue the new item value
238: * @throws DataStoreException
239: */
240: public void setExamplesPageUrl(String newValue)
241: throws DataStoreException {
242: setString(EXAMPLES_PAGE_URL, newValue);
243: }
244:
245: /**
246: * Set the value of the examples.page_url column for the specified row.
247: * @param row which row in the table
248: * @param newValue the new item value
249: * @throws DataStoreException
250: */
251: public void setExamplesPageUrl(int row, String newValue)
252: throws DataStoreException {
253: setString(row, EXAMPLES_PAGE_URL, newValue);
254: }
255:
256: /**
257: * Retrieve the value of the source_code.example_id column for the current row.
258: * @return int
259: * @throws DataStoreException
260: */
261: public int getSourceCodeExampleId() throws DataStoreException {
262: return getInt(SOURCE_CODE_EXAMPLE_ID);
263: }
264:
265: /**
266: * Retrieve the value of the source_code.example_id column for the specified row.
267: * @param row which row in the table
268: * @return int
269: * @throws DataStoreException
270: */
271: public int getSourceCodeExampleId(int row)
272: throws DataStoreException {
273: return getInt(row, SOURCE_CODE_EXAMPLE_ID);
274: }
275:
276: /**
277: * Set the value of the source_code.example_id column for the current row.
278: * @param newValue the new item value
279: * @throws DataStoreException
280: */
281: public void setSourceCodeExampleId(int newValue)
282: throws DataStoreException {
283: setInt(SOURCE_CODE_EXAMPLE_ID, newValue);
284: }
285:
286: /**
287: * Set the value of the source_code.example_id column for the specified row.
288: * @param row which row in the table
289: * @param newValue the new item value
290: * @throws DataStoreException
291: */
292: public void setSourceCodeExampleId(int row, int newValue)
293: throws DataStoreException {
294: setInt(row, SOURCE_CODE_EXAMPLE_ID, newValue);
295: }
296:
297: /**
298: * Retrieve the value of the source_code.filename column for the current row.
299: * @return String
300: * @throws DataStoreException
301: */
302: public String getSourceCodeFilename() throws DataStoreException {
303: return getString(SOURCE_CODE_FILENAME);
304: }
305:
306: /**
307: * Retrieve the value of the source_code.filename column for the specified row.
308: * @param row which row in the table
309: * @return String
310: * @throws DataStoreException
311: */
312: public String getSourceCodeFilename(int row)
313: throws DataStoreException {
314: return getString(row, SOURCE_CODE_FILENAME);
315: }
316:
317: /**
318: * Set the value of the source_code.filename column for the current row.
319: * @param newValue the new item value
320: * @throws DataStoreException
321: */
322: public void setSourceCodeFilename(String newValue)
323: throws DataStoreException {
324: setString(SOURCE_CODE_FILENAME, newValue);
325: }
326:
327: /**
328: * Set the value of the source_code.filename column for the specified row.
329: * @param row which row in the table
330: * @param newValue the new item value
331: * @throws DataStoreException
332: */
333: public void setSourceCodeFilename(int row, String newValue)
334: throws DataStoreException {
335: setString(row, SOURCE_CODE_FILENAME, newValue);
336: }
337:
338: /**
339: * Retrieve the value of the source_code.description column for the current row.
340: * @return String
341: * @throws DataStoreException
342: */
343: public String getSourceCodeDescription() throws DataStoreException {
344: return getString(SOURCE_CODE_DESCRIPTION);
345: }
346:
347: /**
348: * Retrieve the value of the source_code.description column for the specified row.
349: * @param row which row in the table
350: * @return String
351: * @throws DataStoreException
352: */
353: public String getSourceCodeDescription(int row)
354: throws DataStoreException {
355: return getString(row, SOURCE_CODE_DESCRIPTION);
356: }
357:
358: /**
359: * Set the value of the source_code.description column for the current row.
360: * @param newValue the new item value
361: * @throws DataStoreException
362: */
363: public void setSourceCodeDescription(String newValue)
364: throws DataStoreException {
365: setString(SOURCE_CODE_DESCRIPTION, newValue);
366: }
367:
368: /**
369: * Set the value of the source_code.description column for the specified row.
370: * @param row which row in the table
371: * @param newValue the new item value
372: * @throws DataStoreException
373: */
374: public void setSourceCodeDescription(int row, String newValue)
375: throws DataStoreException {
376: setString(row, SOURCE_CODE_DESCRIPTION, newValue);
377: }
378:
379: //$CUSTOMMETHODS$
380: //Put custom methods between these comments, otherwise they will be overwritten if the model is regenerated
381:
382: //$ENDCUSTOMMETHODS$
383:
384: }
|