001: package com.salmonllc.examples.example20;
002:
003: //The Salmon Open Framework for Internet Applications (SOFIA)
004: //Copyright (C) 1999 - 2004, Salmon LLC
005: //
006: //This program is free software; you can redistribute it and/or
007: //modify it under the terms of the GNU General Public License version 2
008: //as published by the Free Software Foundation;
009: //
010: //This program is distributed in the hope that it will be useful,
011: //but WITHOUT ANY WARRANTY; without even the implied warranty of
012: //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
013: //GNU General Public License for more details.
014: //
015: //You should have received a copy of the GNU General Public License
016: //along with this program; if not, write to the Free Software
017: //Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
018: //
019: //For more information please visit http://www.salmonllc.com
020:
021: import com.salmonllc.sql.*;
022:
023: //$CUSTOMIMPORTS$
024: //Put custom imports between these comments, otherwise they will be overwritten if the model is regenerated
025:
026: //$ENDCUSTOMIMPORTS$
027:
028: /**
029: * ExampleModel: A SOFIA generated model
030: */
031: public class ExampleModel extends DataStore {
032:
033: //constants for columns
034: public static final String EXAMPLES_EXAMPLE_ID = "examples.example_id";
035: public static final String EXAMPLES_NAME = "examples.name";
036: public static final String EXAMPLES_EXPLANATION = "examples.explanation";
037: public static final String EXAMPLES_PAGE_URL = "examples.page_url";
038:
039: //$CUSTOMVARS$
040: //Put custom instance variables between these comments, otherwise they will be overwritten if the model is regenerated
041:
042: //$ENDCUSTOMVARS$
043:
044: /**
045: * Create a new ExampleModel object.
046: * @param appName The SOFIA application name
047: */
048: public ExampleModel(String appName) {
049: this (appName, null);
050: }
051:
052: /**
053: * Create a new ExampleModel object.
054: * @param appName The SOFIA application name
055: * @param profile The database profile to use
056: */
057: public ExampleModel(String appName, String profile) {
058: super (appName, profile);
059:
060: //add columns
061: addColumn(computeTableName("examples"), "example_id",
062: DataStore.DATATYPE_INT, true, true, EXAMPLES_EXAMPLE_ID);
063: addColumn(computeTableName("examples"), "name",
064: DataStore.DATATYPE_STRING, false, true, EXAMPLES_NAME);
065: addColumn(computeTableName("examples"), "explanation",
066: DataStore.DATATYPE_STRING, false, true,
067: EXAMPLES_EXPLANATION);
068: addColumn(computeTableName("examples"), "page_url",
069: DataStore.DATATYPE_STRING, false, true,
070: EXAMPLES_PAGE_URL);
071:
072: //$CUSTOMCONSTRUCTOR$
073: //Put custom constructor code between these comments, otherwise it be overwritten if the model is regenerated
074:
075: //$ENDCUSTOMCONSTRUCTOR$
076:
077: }
078:
079: /**
080: * Retrieve the value of the examples.example_id column for the current row.
081: * @return int
082: * @throws DataStoreException
083: */
084: public int getExamplesExampleId() throws DataStoreException {
085: return getInt(EXAMPLES_EXAMPLE_ID);
086: }
087:
088: /**
089: * Retrieve the value of the examples.example_id column for the specified row.
090: * @param row which row in the table
091: * @return int
092: * @throws DataStoreException
093: */
094: public int getExamplesExampleId(int row) throws DataStoreException {
095: return getInt(row, EXAMPLES_EXAMPLE_ID);
096: }
097:
098: /**
099: * Set the value of the examples.example_id column for the current row.
100: * @param newValue the new item value
101: * @throws DataStoreException
102: */
103: public void setExamplesExampleId(int newValue)
104: throws DataStoreException {
105: setInt(EXAMPLES_EXAMPLE_ID, newValue);
106: }
107:
108: /**
109: * Set the value of the examples.example_id column for the specified row.
110: * @param row which row in the table
111: * @param newValue the new item value
112: * @throws DataStoreException
113: */
114: public void setExamplesExampleId(int row, int newValue)
115: throws DataStoreException {
116: setInt(row, EXAMPLES_EXAMPLE_ID, newValue);
117: }
118:
119: /**
120: * Retrieve the value of the examples.name column for the current row.
121: * @return String
122: * @throws DataStoreException
123: */
124: public String getExamplesName() throws DataStoreException {
125: return getString(EXAMPLES_NAME);
126: }
127:
128: /**
129: * Retrieve the value of the examples.name column for the specified row.
130: * @param row which row in the table
131: * @return String
132: * @throws DataStoreException
133: */
134: public String getExamplesName(int row) throws DataStoreException {
135: return getString(row, EXAMPLES_NAME);
136: }
137:
138: /**
139: * Set the value of the examples.name column for the current row.
140: * @param newValue the new item value
141: * @throws DataStoreException
142: */
143: public void setExamplesName(String newValue)
144: throws DataStoreException {
145: setString(EXAMPLES_NAME, newValue);
146: }
147:
148: /**
149: * Set the value of the examples.name column for the specified row.
150: * @param row which row in the table
151: * @param newValue the new item value
152: * @throws DataStoreException
153: */
154: public void setExamplesName(int row, String newValue)
155: throws DataStoreException {
156: setString(row, EXAMPLES_NAME, newValue);
157: }
158:
159: /**
160: * Retrieve the value of the examples.explanation column for the current row.
161: * @return String
162: * @throws DataStoreException
163: */
164: public String getExamplesExplanation() throws DataStoreException {
165: return getString(EXAMPLES_EXPLANATION);
166: }
167:
168: /**
169: * Retrieve the value of the examples.explanation column for the specified row.
170: * @param row which row in the table
171: * @return String
172: * @throws DataStoreException
173: */
174: public String getExamplesExplanation(int row)
175: throws DataStoreException {
176: return getString(row, EXAMPLES_EXPLANATION);
177: }
178:
179: /**
180: * Set the value of the examples.explanation column for the current row.
181: * @param newValue the new item value
182: * @throws DataStoreException
183: */
184: public void setExamplesExplanation(String newValue)
185: throws DataStoreException {
186: setString(EXAMPLES_EXPLANATION, newValue);
187: }
188:
189: /**
190: * Set the value of the examples.explanation column for the specified row.
191: * @param row which row in the table
192: * @param newValue the new item value
193: * @throws DataStoreException
194: */
195: public void setExamplesExplanation(int row, String newValue)
196: throws DataStoreException {
197: setString(row, EXAMPLES_EXPLANATION, newValue);
198: }
199:
200: /**
201: * Retrieve the value of the examples.page_url column for the current row.
202: * @return String
203: * @throws DataStoreException
204: */
205: public String getExamplesPageUrl() throws DataStoreException {
206: return getString(EXAMPLES_PAGE_URL);
207: }
208:
209: /**
210: * Retrieve the value of the examples.page_url column for the specified row.
211: * @param row which row in the table
212: * @return String
213: * @throws DataStoreException
214: */
215: public String getExamplesPageUrl(int row) throws DataStoreException {
216: return getString(row, EXAMPLES_PAGE_URL);
217: }
218:
219: /**
220: * Set the value of the examples.page_url column for the current row.
221: * @param newValue the new item value
222: * @throws DataStoreException
223: */
224: public void setExamplesPageUrl(String newValue)
225: throws DataStoreException {
226: setString(EXAMPLES_PAGE_URL, newValue);
227: }
228:
229: /**
230: * Set the value of the examples.page_url column for the specified row.
231: * @param row which row in the table
232: * @param newValue the new item value
233: * @throws DataStoreException
234: */
235: public void setExamplesPageUrl(int row, String newValue)
236: throws DataStoreException {
237: setString(row, EXAMPLES_PAGE_URL, newValue);
238: }
239:
240: //$CUSTOMMETHODS$
241: //Put custom methods between these comments, otherwise they will be overwritten if the model is regenerated
242:
243: //$ENDCUSTOMMETHODS$
244:
245: }
|