ExampleModel.java :  » J2EE » Sofia » com » salmonllc » examples » example20 » Java Open Source

Java Open Source » J2EE » Sofia 
Sofia » com » salmonllc » examples » example20 » ExampleModel.java
package com.salmonllc.examples.example20;
//The Salmon Open Framework for Internet Applications (SOFIA)
//Copyright (C) 1999 - 2004, Salmon LLC
//
//This program is free software; you can redistribute it and/or
//modify it under the terms of the GNU General Public License version 2
//as published by the Free Software Foundation; 
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with this program; if not, write to the Free Software
//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
//
//For more information please visit http://www.salmonllc.com

import com.salmonllc.sql.*;

//$CUSTOMIMPORTS$
//Put custom imports between these comments, otherwise they will be overwritten if the model is regenerated

//$ENDCUSTOMIMPORTS$

/**
 * ExampleModel: A SOFIA generated model
 */
public class ExampleModel extends DataStore {

     //constants for columns
     public static final String EXAMPLES_EXAMPLE_ID="examples.example_id";
     public static final String EXAMPLES_NAME="examples.name";
     public static final String EXAMPLES_EXPLANATION="examples.explanation";
     public static final String EXAMPLES_PAGE_URL="examples.page_url";

     //$CUSTOMVARS$
     //Put custom instance variables between these comments, otherwise they will be overwritten if the model is regenerated
     
     //$ENDCUSTOMVARS$
     
     /**
      * Create a new ExampleModel object.
      * @param appName The SOFIA application name
      */
     public ExampleModel (String appName) { 
          this(appName, null);
     }

     /**
      * Create a new ExampleModel object.
      * @param appName The SOFIA application name
      * @param profile The database profile to use
      */
     public ExampleModel (String appName, String profile) { 
          super(appName, profile);

          //add columns
          addColumn(computeTableName("examples"),"example_id",DataStore.DATATYPE_INT,true,true,EXAMPLES_EXAMPLE_ID);
          addColumn(computeTableName("examples"),"name",DataStore.DATATYPE_STRING,false,true,EXAMPLES_NAME);
          addColumn(computeTableName("examples"),"explanation",DataStore.DATATYPE_STRING,false,true,EXAMPLES_EXPLANATION);
          addColumn(computeTableName("examples"),"page_url",DataStore.DATATYPE_STRING,false,true,EXAMPLES_PAGE_URL);

          //$CUSTOMCONSTRUCTOR$
          //Put custom constructor code between these comments, otherwise it be overwritten if the model is regenerated

          //$ENDCUSTOMCONSTRUCTOR$

     }

     /**
      * Retrieve the value of the examples.example_id column for the current row.
      * @return int
      * @throws DataStoreException
      */ 
     public int getExamplesExampleId() throws DataStoreException {
          return  getInt(EXAMPLES_EXAMPLE_ID);
     }

     /**
      * Retrieve the value of the examples.example_id column for the specified row.
      * @param row which row in the table
      * @return int
      * @throws DataStoreException
      */ 
     public int getExamplesExampleId(int row) throws DataStoreException {
          return  getInt(row,EXAMPLES_EXAMPLE_ID);
     }

     /**
      * Set the value of the examples.example_id column for the current row.
      * @param newValue the new item value
      * @throws DataStoreException
      */ 
     public void setExamplesExampleId(int newValue) throws DataStoreException {
          setInt(EXAMPLES_EXAMPLE_ID, newValue);
     }

     /**
      * Set the value of the examples.example_id column for the specified row.
      * @param row which row in the table
      * @param newValue the new item value
      * @throws DataStoreException
      */ 
     public void setExamplesExampleId(int row,int newValue) throws DataStoreException {
          setInt(row,EXAMPLES_EXAMPLE_ID, newValue);
     }

     /**
      * Retrieve the value of the examples.name column for the current row.
      * @return String
      * @throws DataStoreException
      */ 
     public String getExamplesName() throws DataStoreException {
          return  getString(EXAMPLES_NAME);
     }

     /**
      * Retrieve the value of the examples.name column for the specified row.
      * @param row which row in the table
      * @return String
      * @throws DataStoreException
      */ 
     public String getExamplesName(int row) throws DataStoreException {
          return  getString(row,EXAMPLES_NAME);
     }

     /**
      * Set the value of the examples.name column for the current row.
      * @param newValue the new item value
      * @throws DataStoreException
      */ 
     public void setExamplesName(String newValue) throws DataStoreException {
          setString(EXAMPLES_NAME, newValue);
     }

     /**
      * Set the value of the examples.name column for the specified row.
      * @param row which row in the table
      * @param newValue the new item value
      * @throws DataStoreException
      */ 
     public void setExamplesName(int row,String newValue) throws DataStoreException {
          setString(row,EXAMPLES_NAME, newValue);
     }

     /**
      * Retrieve the value of the examples.explanation column for the current row.
      * @return String
      * @throws DataStoreException
      */ 
     public String getExamplesExplanation() throws DataStoreException {
          return  getString(EXAMPLES_EXPLANATION);
     }

     /**
      * Retrieve the value of the examples.explanation column for the specified row.
      * @param row which row in the table
      * @return String
      * @throws DataStoreException
      */ 
     public String getExamplesExplanation(int row) throws DataStoreException {
          return  getString(row,EXAMPLES_EXPLANATION);
     }

     /**
      * Set the value of the examples.explanation column for the current row.
      * @param newValue the new item value
      * @throws DataStoreException
      */ 
     public void setExamplesExplanation(String newValue) throws DataStoreException {
          setString(EXAMPLES_EXPLANATION, newValue);
     }

     /**
      * Set the value of the examples.explanation column for the specified row.
      * @param row which row in the table
      * @param newValue the new item value
      * @throws DataStoreException
      */ 
     public void setExamplesExplanation(int row,String newValue) throws DataStoreException {
          setString(row,EXAMPLES_EXPLANATION, newValue);
     }

     /**
      * Retrieve the value of the examples.page_url column for the current row.
      * @return String
      * @throws DataStoreException
      */ 
     public String getExamplesPageUrl() throws DataStoreException {
          return  getString(EXAMPLES_PAGE_URL);
     }

     /**
      * Retrieve the value of the examples.page_url column for the specified row.
      * @param row which row in the table
      * @return String
      * @throws DataStoreException
      */ 
     public String getExamplesPageUrl(int row) throws DataStoreException {
          return  getString(row,EXAMPLES_PAGE_URL);
     }

     /**
      * Set the value of the examples.page_url column for the current row.
      * @param newValue the new item value
      * @throws DataStoreException
      */ 
     public void setExamplesPageUrl(String newValue) throws DataStoreException {
          setString(EXAMPLES_PAGE_URL, newValue);
     }

     /**
      * Set the value of the examples.page_url column for the specified row.
      * @param row which row in the table
      * @param newValue the new item value
      * @throws DataStoreException
      */ 
     public void setExamplesPageUrl(int row,String newValue) throws DataStoreException {
          setString(row,EXAMPLES_PAGE_URL, newValue);
     }
     
     //$CUSTOMMETHODS$
     //Put custom methods between these comments, otherwise they will be overwritten if the model is regenerated
     
     //$ENDCUSTOMMETHODS$
     
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.