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: * SourceCodeModel: A SOFIA generated model
029: */
030: public class SourceCodeModel extends DataStore {
031:
032: //constants for columns
033: public static final String SOURCE_CODE_EXAMPLE_ID = "source_code.example_id";
034: public static final String SOURCE_CODE_FILENAME = "source_code.filename";
035: public static final String SOURCE_CODE_DESCRIPTION = "source_code.description";
036:
037: //$CUSTOMVARS$
038: //Put custom instance variables between these comments, otherwise they will be overwritten if the model is regenerated
039:
040: //$ENDCUSTOMVARS$
041:
042: /**
043: * Create a new SourceCodeModel object.
044: * @param appName The SOFIA application name
045: */
046: public SourceCodeModel(String appName) {
047: this (appName, null);
048: }
049:
050: /**
051: * Create a new SourceCodeModel object.
052: * @param appName The SOFIA application name
053: * @param profile The database profile to use
054: */
055: public SourceCodeModel(String appName, String profile) {
056: super (appName, profile);
057:
058: //add columns
059: addColumn(computeTableName("source_code"), "example_id",
060: DataStore.DATATYPE_INT, true, true,
061: SOURCE_CODE_EXAMPLE_ID);
062: addColumn(computeTableName("source_code"), "filename",
063: DataStore.DATATYPE_STRING, true, true,
064: SOURCE_CODE_FILENAME);
065: addColumn(computeTableName("source_code"), "description",
066: DataStore.DATATYPE_STRING, false, true,
067: SOURCE_CODE_DESCRIPTION);
068:
069: //$CUSTOMCONSTRUCTOR$
070: //Put custom constructor code between these comments, otherwise it be overwritten if the model is regenerated
071:
072: //$ENDCUSTOMCONSTRUCTOR$
073:
074: }
075:
076: /**
077: * Retrieve the value of the source_code.example_id column for the current row.
078: * @return int
079: * @throws DataStoreException
080: */
081: public int getSourceCodeExampleId() throws DataStoreException {
082: return getInt(SOURCE_CODE_EXAMPLE_ID);
083: }
084:
085: /**
086: * Retrieve the value of the source_code.example_id column for the specified row.
087: * @param row which row in the table
088: * @return int
089: * @throws DataStoreException
090: */
091: public int getSourceCodeExampleId(int row)
092: throws DataStoreException {
093: return getInt(row, SOURCE_CODE_EXAMPLE_ID);
094: }
095:
096: /**
097: * Set the value of the source_code.example_id column for the current row.
098: * @param newValue the new item value
099: * @throws DataStoreException
100: */
101: public void setSourceCodeExampleId(int newValue)
102: throws DataStoreException {
103: setInt(SOURCE_CODE_EXAMPLE_ID, newValue);
104: }
105:
106: /**
107: * Set the value of the source_code.example_id column for the specified row.
108: * @param row which row in the table
109: * @param newValue the new item value
110: * @throws DataStoreException
111: */
112: public void setSourceCodeExampleId(int row, int newValue)
113: throws DataStoreException {
114: setInt(row, SOURCE_CODE_EXAMPLE_ID, newValue);
115: }
116:
117: /**
118: * Retrieve the value of the source_code.filename column for the current row.
119: * @return String
120: * @throws DataStoreException
121: */
122: public String getSourceCodeFilename() throws DataStoreException {
123: return getString(SOURCE_CODE_FILENAME);
124: }
125:
126: /**
127: * Retrieve the value of the source_code.filename column for the specified row.
128: * @param row which row in the table
129: * @return String
130: * @throws DataStoreException
131: */
132: public String getSourceCodeFilename(int row)
133: throws DataStoreException {
134: return getString(row, SOURCE_CODE_FILENAME);
135: }
136:
137: /**
138: * Set the value of the source_code.filename column for the current row.
139: * @param newValue the new item value
140: * @throws DataStoreException
141: */
142: public void setSourceCodeFilename(String newValue)
143: throws DataStoreException {
144: setString(SOURCE_CODE_FILENAME, newValue);
145: }
146:
147: /**
148: * Set the value of the source_code.filename column for the specified row.
149: * @param row which row in the table
150: * @param newValue the new item value
151: * @throws DataStoreException
152: */
153: public void setSourceCodeFilename(int row, String newValue)
154: throws DataStoreException {
155: setString(row, SOURCE_CODE_FILENAME, newValue);
156: }
157:
158: /**
159: * Retrieve the value of the source_code.description column for the current row.
160: * @return String
161: * @throws DataStoreException
162: */
163: public String getSourceCodeDescription() throws DataStoreException {
164: return getString(SOURCE_CODE_DESCRIPTION);
165: }
166:
167: /**
168: * Retrieve the value of the source_code.description column for the specified row.
169: * @param row which row in the table
170: * @return String
171: * @throws DataStoreException
172: */
173: public String getSourceCodeDescription(int row)
174: throws DataStoreException {
175: return getString(row, SOURCE_CODE_DESCRIPTION);
176: }
177:
178: /**
179: * Set the value of the source_code.description column for the current row.
180: * @param newValue the new item value
181: * @throws DataStoreException
182: */
183: public void setSourceCodeDescription(String newValue)
184: throws DataStoreException {
185: setString(SOURCE_CODE_DESCRIPTION, newValue);
186: }
187:
188: /**
189: * Set the value of the source_code.description column for the specified row.
190: * @param row which row in the table
191: * @param newValue the new item value
192: * @throws DataStoreException
193: */
194: public void setSourceCodeDescription(int row, String newValue)
195: throws DataStoreException {
196: setString(row, SOURCE_CODE_DESCRIPTION, newValue);
197: }
198:
199: //$CUSTOMMETHODS$
200: //Put custom methods between these comments, otherwise they will be overwritten if the model is regenerated
201:
202: //$ENDCUSTOMMETHODS$
203:
204: }
|