head	1.1;
access;
symbols
	HELM_PEER_PORT_BRANCH:1.1.0.2;
locks; strict;
comment	@# @;


1.1
date	2001.01.28.01.18.25;	author dlr;	state dead;
branches
	1.1.2.1;
next	;

1.1.2.1
date	2001.01.28.01.18.25;	author dlr;	state Exp;
branches;
next	1.1.2.2;

1.1.2.2
date	2001.02.01.17.49.45;	author dlr;	state Exp;
branches;
next	1.1.2.3;

1.1.2.3
date	2001.02.02.18.00.03;	author dlr;	state Exp;
branches;
next	1.1.2.4;

1.1.2.4
date	2001.02.02.19.09.49;	author dlr;	state Exp;
branches;
next	1.1.2.5;

1.1.2.5
date	2001.02.07.03.46.30;	author dlr;	state Exp;
branches;
next	1.1.2.6;

1.1.2.6
date	2001.02.07.21.18.02;	author dlr;	state Exp;
branches;
next	1.1.2.7;

1.1.2.7
date	2001.02.09.02.01.53;	author dlr;	state Exp;
branches;
next	1.1.2.8;

1.1.2.8
date	2001.02.09.23.25.42;	author dlr;	state Exp;
branches;
next	1.1.2.9;

1.1.2.9
date	2001.02.13.00.55.54;	author dlr;	state Exp;
branches;
next	1.1.2.10;

1.1.2.10
date	2001.02.13.03.03.05;	author dlr;	state Exp;
branches;
next	1.1.2.11;

1.1.2.11
date	2001.02.16.03.04.58;	author dlr;	state dead;
branches;
next	;


desc
@@


1.1
log
@file BaseSkinStyleElementValuePeer.java was initially added on branch HELM_PEER_PORT_BRANCH.
@
text
@@


1.1.2.1
log
@Classes ported to the Turbine Peer system. -dlr and leonardr
@
text
@a0 333
package org.tigris.helm.om.peer;

// JDK classes
import java.util.*;

// Village classes
import com.workingdogs.village.*;

// Turbine classes
import org.apache.turbine.om.peer.*;
import org.apache.turbine.util.*;
import org.apache.turbine.util.db.*;
import org.apache.turbine.util.db.map.*;
import org.apache.turbine.util.db.pool.DBConnection;

import org.tigris.helm.om.SkinStyleElementValue;

// Local classes
import org.tigris.helm.om.map.*;
import org.tigris.helm.om.*;

/** This class was autogenerated by GenerateMapBuilder on: Fri Jan 26 19:21:34 PST 2001 */
public class BaseSkinStyleElementValuePeer extends BasePeer
{
    /** the mapbuilder for this class */
    private static final SkinStyleElementValueMapBuilder mapBuilder = 
        (SkinStyleElementValueMapBuilder)getMapBuilder(SkinStyleElementValueMapBuilder.CLASS_NAME);

    /** the table name for this class */
    public static final String TABLE_NAME = mapBuilder.getTable();

    /** the column name for the SKIN_ID field */
    public static final String SKIN_ID = mapBuilder.getSkinStyleElementValue_SkinId();
    /** the column name for the STYLE_ID field */
    public static final String STYLE_ID = mapBuilder.getSkinStyleElementValue_StyleId();
    /** the column name for the ELEMENT_ID field */
    public static final String ELEMENT_ID = mapBuilder.getSkinStyleElementValue_ElementId();
    /** the column name for the VALUE field */
    public static final String VALUE = mapBuilder.getSkinStyleElementValue_Value();

    /** number of columns for this peer */
    public static final int numColumns =  4;;

    /** Method to do inserts */
    public static Object doInsert( Criteria criteria ) throws Exception
    {
        criteria.setDbName(getMapBuilder().getDatabaseMap().getName());
                                                                     return BasePeer.doInsert( criteria );
    }

    /** 
     * Method to do inserts.  This method is to be used during a transaction,
     * otherwise use the doInsert(Criteria) method.  It will take care of 
     * the connection details internally. 
     */
    public static Object doInsert( Criteria criteria, DBConnection dbCon ) throws Exception
    {
        criteria.setDbName(getMapBuilder().getDatabaseMap().getName());
                                                                     return BasePeer.doInsert( criteria, dbCon );
    }

    /** Add all the columns needed to create a new object */
    public static void addSelectColumns (Criteria criteria) throws Exception
    {
            criteria.addSelectColumn( SKIN_ID );
            criteria.addSelectColumn( STYLE_ID );
            criteria.addSelectColumn( ELEMENT_ID );
            criteria.addSelectColumn( VALUE );
        }


    /** Create a new object of type cls from a resultset row starting
      * from a specified offset.  This is done so that you can select
      * other rows than just those needed for this object.  You may
      * for example want to create two objects from the same row.
      */
    public static SkinStyleElementValue row2Object (Record row, int offset, Class cls ) throws Exception
    {
        SkinStyleElementValue obj = (SkinStyleElementValue)cls.newInstance();
                                        obj.setSkinId(row.getValue(offset+0).asInt());
                                            obj.setStyleId(row.getValue(offset+1).asInt());
                                            obj.setElementId(row.getValue(offset+2).asInt());
                                            obj.setValue(row.getValue(offset+3).asString());
                                        obj.setModified(false);
                obj.setNew(false);
        return obj;
    }

    /** Method to do selects */
    public static Vector doSelect( Criteria criteria ) throws Exception
    {
        criteria.setDbName(getMapBuilder().getDatabaseMap().getName());
        return doSelect (criteria,"org.tigris.helm.om.SkinStyleElementValue", null);
    }

    /** 
     * Method to do selects.  This method is to be used during a transaction,
     * otherwise use the doSelect(Criteria) method.  It will take care of 
     * the connection details internally. 
     */
    public static Vector doSelect( Criteria criteria, DBConnection dbCon ) throws Exception
    {
        criteria.setDbName(getMapBuilder().getDatabaseMap().getName());
        return doSelect (criteria,"org.tigris.helm.om.SkinStyleElementValue", dbCon);
    }

    /** Method to do selects. The returned vector will have object
      * of className
      */
    public static Vector doSelect( Criteria criteria, String className, DBConnection dbCon) throws Exception
    {
        addSelectColumns ( criteria );

                                                             
        // BasePeer returns a Vector of Value (Village) arrays.  The array
        // order follows the order columns were placed in the Select clause.
        Vector rows = null;
        if (dbCon == null)
        {
            rows = BasePeer.doSelect(criteria);
        }
        else
        {
            rows = BasePeer.doSelect(criteria, dbCon);
        }
        Vector results = new Vector();

        // populate the object(s)
        for ( int i=0; i<rows.size(); i++ )
        {
            Record row = (Record)rows.elementAt(i);
            results.add (row2Object (row,1,Class.forName (className)));
         }
         return results;
    }

    /**
     * Method to do updates. 
     *
     * @@param Criteria object containing data that is used to create the UPDATE statement.
     */
    public static void doUpdate(Criteria criteria) throws Exception
    {
        criteria.setDbName(getMapBuilder().getDatabaseMap().getName());
        Criteria selectCriteria = new Criteria(2);
                                selectCriteria.put( SKIN_ID, criteria.remove(SKIN_ID) );
                                         selectCriteria.put( STYLE_ID, criteria.remove(STYLE_ID) );
                                         selectCriteria.put( ELEMENT_ID, criteria.remove(ELEMENT_ID) );
                                              BasePeer.doUpdate( selectCriteria, criteria );
    }

    /** 
     * Method to do updates.  This method is to be used during a transaction,
     * otherwise use the doUpdate(Criteria) method.  It will take care of 
     * the connection details internally. 
     *
     * @@param Criteria object containing data that is used to create the UPDATE statement.
     */
    public static void doUpdate(Criteria criteria, DBConnection dbCon) throws Exception
    {
         criteria.setDbName(getMapBuilder().getDatabaseMap().getName());
         Criteria selectCriteria = new Criteria(2);
                                selectCriteria.put( SKIN_ID, criteria.remove(SKIN_ID) );
                                         selectCriteria.put( STYLE_ID, criteria.remove(STYLE_ID) );
                                         selectCriteria.put( ELEMENT_ID, criteria.remove(ELEMENT_ID) );
                                              BasePeer.doUpdate( selectCriteria, criteria, dbCon );
     }

    /** 
     * Method to do deletes.
     *
     * @@param Criteria object containing data that is used DELETE from database.
     */
     public static void doDelete(Criteria criteria) throws Exception
     {
         criteria.setDbName(getMapBuilder().getDatabaseMap().getName());
                                                                      BasePeer.doDelete ( criteria );
     }

    /** 
     * Method to do deletes.  This method is to be used during a transaction,
     * otherwise use the doInsert(Criteria) method.  It will take care of 
     * the connection details internally. 
     *
     * @@param Criteria object containing data that is used DELETE from database.
     */
     public static void doDelete(Criteria criteria, DBConnection dbCon) throws Exception
     {
         criteria.setDbName(getMapBuilder().getDatabaseMap().getName());
                                                                      BasePeer.doDelete ( criteria, dbCon );
     }

    /** Method to do inserts */
    public static void doInsert( SkinStyleElementValue obj ) throws Exception
    {
                obj.setPrimaryKey(doInsert(buildCriteria(obj)));
                obj.setNew(false);
    }

    /**
     * @@param obj the data object to update in the database.
     */
    public static void doUpdate(SkinStyleElementValue obj) throws Exception
    {
        doUpdate(buildCriteria(obj));
    }
    /**
     * @@param obj the data object to delete in the database.
     */
    public static void doDelete(SkinStyleElementValue obj) throws Exception
    {
        doDelete(buildCriteria(obj));
    }

    /** 
     * Method to do inserts.  This method is to be used during a transaction,
     * otherwise use the doInsert(SkinStyleElementValue) method.  It will take 
     * care of the connection details internally. 
     *
     * @@param obj the data object to insert into the database.
     */
    public static void doInsert( SkinStyleElementValue obj, DBConnection dbCon) throws Exception
    {
                obj.setPrimaryKey(doInsert(buildCriteria(obj), dbCon));
                obj.setNew(false);
    }

    /**
     * Method to do update.  This method is to be used during a transaction,
     * otherwise use the doUpdate(SkinStyleElementValue) method.  It will take 
     * care of the connection details internally. 
     *
     * @@param obj the data object to update in the database.
     */
    public static void doUpdate(SkinStyleElementValue obj, DBConnection dbCon) throws Exception
    {
        doUpdate(buildCriteria(obj), dbCon);
    }
    /**
     * Method to delete.  This method is to be used during a transaction,
     * otherwise use the doDelete(SkinStyleElementValue) method.  It will take 
     * care of the connection details internally. 
     *
     * @@param obj the data object to delete in the database.
     */
    public static void doDelete(SkinStyleElementValue obj, DBConnection dbCon) throws Exception
    {
        doDelete(buildCriteria(obj), dbCon);
    }

    /** Build a Criteria object from the data object for this peer */
    public static Criteria buildCriteria( SkinStyleElementValue obj )
    {
        Criteria criteria = new Criteria();
                            if ( !obj.isNew() )
	                criteria.add( SKIN_ID, obj.getSkinId() );
                            if ( !obj.isNew() )
	                criteria.add( STYLE_ID, obj.getStyleId() );
                            if ( !obj.isNew() )
	                criteria.add( ELEMENT_ID, obj.getElementId() );
                                criteria.add( VALUE, obj.getValue() );
                return criteria;
    }

    /** 
     * Retrieve a single object by pk where multiple PK's are separated
     * by colons
     *
     * @@param int skin_id
     * @@param int style_id
     * @@param int element_id
     */
    public static SkinStyleElementValue retrieveById(Object pkid) 
        throws Exception
    {
        StringTokenizer stok = new StringTokenizer((String)pkid, ":");
        if ( stok.countTokens() < 3 )
        {   
            throw new TurbineException(
                "id tokens did not match number of primary keys" );
        }
           int skin_id = Integer.parseInt(stok.nextToken());;
           int style_id = Integer.parseInt(stok.nextToken());;
           int element_id = Integer.parseInt(stok.nextToken());;

       return retrieveByPK(
             skin_id
              , style_id
              , element_id
              );
    }

    /** 
     * Retrieve a single object by pk
     *
     * @@param int skin_id
     * @@param int style_id
     * @@param int element_id
     */
    public static SkinStyleElementValue retrieveByPK(
                      int skin_id
                                      , int style_id
                                      , int element_id
                                         ) throws Exception
    {
        Criteria criteria = new Criteria();
                       if( skin_id > 0 )
                  criteria.add( BaseSkinStyleElementValuePeer.SKIN_ID, skin_id );
                            if( style_id > 0 )
                  criteria.add( BaseSkinStyleElementValuePeer.STYLE_ID, style_id );
                            if( element_id > 0 )
                  criteria.add( BaseSkinStyleElementValuePeer.ELEMENT_ID, element_id );
                          Vector SkinStyleElementValueVector = doSelect(criteria);
        if (SkinStyleElementValueVector.size() != 1)
        {
            throw new Exception("Failed to select one and only one row.");
        }
        else
        {
            return (SkinStyleElementValue) SkinStyleElementValueVector.firstElement();
        }
    }


}








@


1.1.2.2
log
@Mark these base peer classes as 'abstract class', rather than 'public class' to better note that their extensions should be used.
@
text
@d23 1
a23 1
abstract class BaseSkinStyleElementValuePeer extends BasePeer
@


1.1.2.3
log
@Regenerated BasePeer extensions.
@
text
@a4 1
import java.math.*;
d22 1
a22 1
/** This class was autogenerated by GenerateMapBuilder on: Fri Feb 02 09:53:57 PST 2001 */
d47 1
a47 1
        criteria.setDbName(mapBuilder.getDatabaseMap().getName());
d58 1
a58 1
        criteria.setDbName(mapBuilder.getDatabaseMap().getName());
d92 1
a92 1
        criteria.setDbName(mapBuilder.getDatabaseMap().getName());
d103 1
a103 1
        criteria.setDbName(mapBuilder.getDatabaseMap().getName());
d144 1
a144 1
        criteria.setDbName(mapBuilder.getDatabaseMap().getName());
d161 1
a161 1
         criteria.setDbName(mapBuilder.getDatabaseMap().getName());
d176 1
a176 1
         criteria.setDbName(mapBuilder.getDatabaseMap().getName());
d189 1
a189 1
         criteria.setDbName(mapBuilder.getDatabaseMap().getName());
d308 1
a308 1
                  criteria.add( SkinStyleElementValuePeer.SKIN_ID, skin_id );
d310 1
a310 1
                  criteria.add( SkinStyleElementValuePeer.STYLE_ID, style_id );
d312 1
a312 1
                  criteria.add( SkinStyleElementValuePeer.ELEMENT_ID, element_id );
@


1.1.2.4
log
@Regenerated BasePeer extensions.
@
text
@d23 1
a23 1
/** This class was autogenerated by GenerateMapBuilder on: Fri Feb 02 11:12:25 PST 2001 */
d197 1
a197 1
                doInsert(buildCriteria(obj));
d225 1
a225 1
                doInsert(buildCriteria(obj), dbCon);
d256 6
a261 3
                                criteria.add( SKIN_ID, obj.getSkinId() );
                                criteria.add( STYLE_ID, obj.getStyleId() );
                                criteria.add( ELEMENT_ID, obj.getElementId() );
@


1.1.2.5
log
@Latest Torque generated code (simple object model).
@
text
@d23 2
a24 2
/** This class was autogenerated by GenerateMapBuilder on: Tue Feb 06 19:46:40 PST 2001 */
public abstract class BaseSkinStyleElementValuePeer extends BasePeer
d146 1
a146 2
        Criteria selectCriteria = new
            Criteria(mapBuilder.getDatabaseMap().getName(), 2);
d162 2
a163 3
        criteria.setDbName(mapBuilder.getDatabaseMap().getName());
        Criteria selectCriteria = new
            Criteria(mapBuilder.getDatabaseMap().getName(), 2);
@


1.1.2.6
log
@Newest generated code (complex model this time).  Removed getUsers from Domain to side step decl conflict.
@
text
@d23 1
a23 1
/** This class was autogenerated by GenerateMapBuilder on: Wed Feb 07 12:45:09 PST 2001 */
a324 470
       
        
                       
     
          


   /**
    * selects a collection of SkinStyleElementValue objects pre-filled with their
    * Skin objects.
    */
    public static Vector doSelectJoinSkin(Criteria c)
        throws Exception
    {
         c.setDbName(mapBuilder.getDatabaseMap().getName());

        addSelectColumns(c);
        int offset = numColumns + 1;
        SkinPeer.addSelectColumns(c);

                                                                     
        Vector rows = BasePeer.doSelect(c);
        Vector results = new Vector();

        for (int i=0; i<rows.size(); i++)
        {
            SkinStyleElementValue obj1 = 
                row2Object((com.workingdogs.village.Record)rows.elementAt(i),
                            1, Class.forName("org.tigris.helm.om.SkinStyleElementValue") );
            Skin obj2 = SkinPeer
                .row2Object((com.workingdogs.village.Record)rows.elementAt(i),
                            offset, Class.forName("org.tigris.helm.om.Skin") );
            
            boolean newObject = true;
            for (int j=0; j<results.size(); j++)
            {
                SkinStyleElementValue temp_obj1 = (SkinStyleElementValue)results.elementAt(j);
                Skin temp_obj2 = temp_obj1.getSkin();
                if ( temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey() ) )
                {
                    newObject = false;
                    temp_obj2.addSkinStyleElementValues(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj2.initSkinStyleElementValues();
                obj2.addSkinStyleElementValues(obj1);
            }
            results.add(obj1);

        }

        return results;
    }
         
                       
     
          


   /**
    * selects a collection of SkinStyleElementValue objects pre-filled with their
    * Style objects.
    */
    public static Vector doSelectJoinStyle(Criteria c)
        throws Exception
    {
         c.setDbName(mapBuilder.getDatabaseMap().getName());

        addSelectColumns(c);
        int offset = numColumns + 1;
        StylePeer.addSelectColumns(c);

                                                                     
        Vector rows = BasePeer.doSelect(c);
        Vector results = new Vector();

        for (int i=0; i<rows.size(); i++)
        {
            SkinStyleElementValue obj1 = 
                row2Object((com.workingdogs.village.Record)rows.elementAt(i),
                            1, Class.forName("org.tigris.helm.om.SkinStyleElementValue") );
            Style obj2 = StylePeer
                .row2Object((com.workingdogs.village.Record)rows.elementAt(i),
                            offset, Class.forName("org.tigris.helm.om.Style") );
            
            boolean newObject = true;
            for (int j=0; j<results.size(); j++)
            {
                SkinStyleElementValue temp_obj1 = (SkinStyleElementValue)results.elementAt(j);
                Style temp_obj2 = temp_obj1.getStyle();
                if ( temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey() ) )
                {
                    newObject = false;
                    temp_obj2.addSkinStyleElementValues(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj2.initSkinStyleElementValues();
                obj2.addSkinStyleElementValues(obj1);
            }
            results.add(obj1);

        }

        return results;
    }
         
                       
     
          


   /**
    * selects a collection of SkinStyleElementValue objects pre-filled with their
    * StyleElement objects.
    */
    public static Vector doSelectJoinStyleElement(Criteria c)
        throws Exception
    {
         c.setDbName(mapBuilder.getDatabaseMap().getName());

        addSelectColumns(c);
        int offset = numColumns + 1;
        StyleElementPeer.addSelectColumns(c);

                                                                     
        Vector rows = BasePeer.doSelect(c);
        Vector results = new Vector();

        for (int i=0; i<rows.size(); i++)
        {
            SkinStyleElementValue obj1 = 
                row2Object((com.workingdogs.village.Record)rows.elementAt(i),
                            1, Class.forName("org.tigris.helm.om.SkinStyleElementValue") );
            StyleElement obj2 = StyleElementPeer
                .row2Object((com.workingdogs.village.Record)rows.elementAt(i),
                            offset, Class.forName("org.tigris.helm.om.StyleElement") );
            
            boolean newObject = true;
            for (int j=0; j<results.size(); j++)
            {
                SkinStyleElementValue temp_obj1 = (SkinStyleElementValue)results.elementAt(j);
                StyleElement temp_obj2 = temp_obj1.getStyleElement();
                if ( temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey() ) )
                {
                    newObject = false;
                    temp_obj2.addSkinStyleElementValues(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj2.initSkinStyleElementValues();
                obj2.addSkinStyleElementValues(obj1);
            }
            results.add(obj1);

        }

        return results;
    }
    

  
  
     
                       
          


   /**
    * selects a collection of SkinStyleElementValue objects pre-filled with 
    * all related objects.
    */
    public static Vector doSelectJoinAllExceptSkin(Criteria c) 
        throws Exception
    {
         c.setDbName(mapBuilder.getDatabaseMap().getName());

        addSelectColumns(c);
        int offset2 = numColumns + 1;
                    
                                      
                StylePeer.addSelectColumns(c);
        int offset3 = offset2 + StylePeer.numColumns;
                                          
                StyleElementPeer.addSelectColumns(c);
        int offset4 = offset3 + StyleElementPeer.numColumns;
                                                                                           
        Vector rows = BasePeer.doSelect(c);
        Vector results = new Vector();

        for (int i=0; i<rows.size(); i++)
        {
            SkinStyleElementValue obj1 = 
                row2Object((com.workingdogs.village.Record)rows.elementAt(i),
                            1, Class.forName("org.tigris.helm.om.SkinStyleElementValue") );
                    
                                  
                                                
                        
                        Style obj2 = StylePeer
                .row2Object((com.workingdogs.village.Record)rows.elementAt(i),
                            offset2, Class.forName("org.tigris.helm.om.Style") );

            
             boolean  newObject = true;
            for (int j=0; j<results.size(); j++)
            {
                SkinStyleElementValue temp_obj1 = (SkinStyleElementValue)results.elementAt(j);
                Style temp_obj2 = temp_obj1.getStyle();
                if ( temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey() ) )
                {
                    newObject = false;
                    temp_obj2.addSkinStyleElementValues(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj2.initSkinStyleElementValues();
                obj2.addSkinStyleElementValues(obj1);
            }
                        
                                                
                        
                        StyleElement obj3 = StyleElementPeer
                .row2Object((com.workingdogs.village.Record)rows.elementAt(i),
                            offset3, Class.forName("org.tigris.helm.om.StyleElement") );

            
             newObject = true;
            for (int j=0; j<results.size(); j++)
            {
                SkinStyleElementValue temp_obj1 = (SkinStyleElementValue)results.elementAt(j);
                StyleElement temp_obj3 = temp_obj1.getStyleElement();
                if ( temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey() ) )
                {
                    newObject = false;
                    temp_obj3.addSkinStyleElementValues(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj3.initSkinStyleElementValues();
                obj3.addSkinStyleElementValues(obj1);
            }
                        results.add(obj1);

        }

        return results;
    }
 
     
                       
          


   /**
    * selects a collection of SkinStyleElementValue objects pre-filled with 
    * all related objects.
    */
    public static Vector doSelectJoinAllExceptStyle(Criteria c) 
        throws Exception
    {
         c.setDbName(mapBuilder.getDatabaseMap().getName());

        addSelectColumns(c);
        int offset2 = numColumns + 1;
                    
                SkinPeer.addSelectColumns(c);
        int offset3 = offset2 + SkinPeer.numColumns;
                                          
                                      
                StyleElementPeer.addSelectColumns(c);
        int offset4 = offset3 + StyleElementPeer.numColumns;
                                                                                           
        Vector rows = BasePeer.doSelect(c);
        Vector results = new Vector();

        for (int i=0; i<rows.size(); i++)
        {
            SkinStyleElementValue obj1 = 
                row2Object((com.workingdogs.village.Record)rows.elementAt(i),
                            1, Class.forName("org.tigris.helm.om.SkinStyleElementValue") );
                    
                                                
                        
                        Skin obj2 = SkinPeer
                .row2Object((com.workingdogs.village.Record)rows.elementAt(i),
                            offset2, Class.forName("org.tigris.helm.om.Skin") );

            
             boolean  newObject = true;
            for (int j=0; j<results.size(); j++)
            {
                SkinStyleElementValue temp_obj1 = (SkinStyleElementValue)results.elementAt(j);
                Skin temp_obj2 = temp_obj1.getSkin();
                if ( temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey() ) )
                {
                    newObject = false;
                    temp_obj2.addSkinStyleElementValues(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj2.initSkinStyleElementValues();
                obj2.addSkinStyleElementValues(obj1);
            }
                        
                                  
                                                
                        
                        StyleElement obj3 = StyleElementPeer
                .row2Object((com.workingdogs.village.Record)rows.elementAt(i),
                            offset3, Class.forName("org.tigris.helm.om.StyleElement") );

            
             newObject = true;
            for (int j=0; j<results.size(); j++)
            {
                SkinStyleElementValue temp_obj1 = (SkinStyleElementValue)results.elementAt(j);
                StyleElement temp_obj3 = temp_obj1.getStyleElement();
                if ( temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey() ) )
                {
                    newObject = false;
                    temp_obj3.addSkinStyleElementValues(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj3.initSkinStyleElementValues();
                obj3.addSkinStyleElementValues(obj1);
            }
                        results.add(obj1);

        }

        return results;
    }
 
     
                       
          


   /**
    * selects a collection of SkinStyleElementValue objects pre-filled with 
    * all related objects.
    */
    public static Vector doSelectJoinAllExceptStyleElement(Criteria c) 
        throws Exception
    {
         c.setDbName(mapBuilder.getDatabaseMap().getName());

        addSelectColumns(c);
        int offset2 = numColumns + 1;
                    
                SkinPeer.addSelectColumns(c);
        int offset3 = offset2 + SkinPeer.numColumns;
                                          
                StylePeer.addSelectColumns(c);
        int offset4 = offset3 + StylePeer.numColumns;
                                          
                                                                                       
        Vector rows = BasePeer.doSelect(c);
        Vector results = new Vector();

        for (int i=0; i<rows.size(); i++)
        {
            SkinStyleElementValue obj1 = 
                row2Object((com.workingdogs.village.Record)rows.elementAt(i),
                            1, Class.forName("org.tigris.helm.om.SkinStyleElementValue") );
                    
                                                
                        
                        Skin obj2 = SkinPeer
                .row2Object((com.workingdogs.village.Record)rows.elementAt(i),
                            offset2, Class.forName("org.tigris.helm.om.Skin") );

            
             boolean  newObject = true;
            for (int j=0; j<results.size(); j++)
            {
                SkinStyleElementValue temp_obj1 = (SkinStyleElementValue)results.elementAt(j);
                Skin temp_obj2 = temp_obj1.getSkin();
                if ( temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey() ) )
                {
                    newObject = false;
                    temp_obj2.addSkinStyleElementValues(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj2.initSkinStyleElementValues();
                obj2.addSkinStyleElementValues(obj1);
            }
                        
                                                
                        
                        Style obj3 = StylePeer
                .row2Object((com.workingdogs.village.Record)rows.elementAt(i),
                            offset3, Class.forName("org.tigris.helm.om.Style") );

            
             newObject = true;
            for (int j=0; j<results.size(); j++)
            {
                SkinStyleElementValue temp_obj1 = (SkinStyleElementValue)results.elementAt(j);
                Style temp_obj3 = temp_obj1.getStyle();
                if ( temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey() ) )
                {
                    newObject = false;
                    temp_obj3.addSkinStyleElementValues(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj3.initSkinStyleElementValues();
                obj3.addSkinStyleElementValues(obj1);
            }
                        
                                  results.add(obj1);

        }

        return results;
    }
  


  
    /** 
     * Retrieve objects by fk
     *
     * @@param int skin_id
     */
//    public static Vector retrieveBySkinId(int skin_id)
//    {
        
    
    /** 
     * Retrieve objects by fk
     *
     * @@param int style_id
     */
//    public static Vector retrieveByStyleId(int style_id)
//    {
        
    
    /** 
     * Retrieve objects by fk
     *
     * @@param int element_id
     */
//    public static Vector retrieveByElementId(int element_id)
//    {
        
    
@


1.1.2.7
log
@Torque autogen files.
@
text
@d23 1
a23 6
/**
  * This class was autogenerated by Torque on:
  *
  * [Thu Feb 08 17:56:55 PST 2001]
  *
  */
@


1.1.2.8
log
@New Torque-generated classes.  NewsItem replaces ProjectNews.
@
text
@d26 1
a26 1
  * [Fri Feb 09 15:29:27 PST 2001]
@


1.1.2.9
log
@New Torque-generated classes.
@
text
@d26 1
a26 1
  * [Mon Feb 12 16:46:43 PST 2001]
d48 1
a48 6
    public static final int numColumns =  4;

    /** A class that can be returned by this peer. */
    protected static final String CLASSNAME_DEFAULT = 
        "org.tigris.helm.om.SkinStyleElementValue";

d78 13
a90 18
    /** 
     * Create a new object of type cls from a resultset row starting
     * from a specified offset.  This is done so that you can select
     * other rows than just those needed for this object.  You may
     * for example want to create two objects from the same row.
     */
    public static SkinStyleElementValue row2Object (Record row, 
                                              int offset, 
                                              String cls ) 
        throws Exception
    {
        SkinStyleElementValue obj = 
            (SkinStyleElementValue)Class.forName(cls).newInstance();
                                                        obj.setSkinId(row.getValue(offset+0).asInt());
                                                                            obj.setStyleId(row.getValue(offset+1).asInt());
                                                                            obj.setElementId(row.getValue(offset+2).asInt());
                                                                            obj.setValue(row.getValue(offset+3).asString());
                                                        obj.setModified(false);
d98 2
a99 10
        return populateObjects( doSelectVillageRecords(criteria) ); 
    }


    /** Method to do selects within a transaction */
    public static Vector doSelect( Criteria criteria, 
                                   DBConnection dbCon ) 
        throws Exception
    {
        return populateObjects( doSelectVillageRecords(criteria, dbCon) ); 
d103 3
a105 2
     * Grabs the raw Village records to be formed into objects.
     * This method handles connections internally 
d107 1
a107 2
    public static Vector doSelectVillageRecords( Criteria criteria ) 
        throws Exception
d110 1
a110 9
        if (criteria.getSelectColumns().size() == 0)
        {
            addSelectColumns ( criteria );
        }

                                                             
        // BasePeer returns a Vector of Value (Village) arrays.  The array
        // order follows the order columns were placed in the Select clause.
        return BasePeer.doSelect(criteria);
d113 4
a116 8

    /** 
     * Grabs the raw Village records to be formed into objects.
     * This method should be used for transactions 
     */
    public static Vector doSelectVillageRecords( Criteria criteria, 
                                                 DBConnection dbCon ) 
        throws Exception
d123 10
a132 11
        return BasePeer.doSelect(criteria, dbCon);
    }

    /** 
     * The returned vector will contain objects of the default type or
     * objects that inherit from the default.
     */
    private static Vector populateObjects(Vector records) 
        throws Exception
    {
        Vector results = new Vector(records.size());
d135 1
a135 1
        for ( int i=0; i<records.size(); i++ )
d137 4
a140 5
            Record row = (Record)records.elementAt(i);

            results.add(row2Object( row,1, CLASSNAME_DEFAULT ));
        }
        return results;
d356 3
a358 5
            Record row = (Record)rows.elementAt(i);

            SkinStyleElementValue obj1 = row2Object( row,1, CLASSNAME_DEFAULT );


d360 2
a361 2
                .row2Object(row, offset, 
                    SkinPeer.CLASSNAME_DEFAULT);
d411 3
a413 5
            Record row = (Record)rows.elementAt(i);

            SkinStyleElementValue obj1 = row2Object( row,1, CLASSNAME_DEFAULT );


d415 2
a416 2
                .row2Object(row, offset, 
                    StylePeer.CLASSNAME_DEFAULT);
d466 3
a468 5
            Record row = (Record)rows.elementAt(i);

            SkinStyleElementValue obj1 = row2Object( row,1, CLASSNAME_DEFAULT );


d470 2
a471 2
                .row2Object(row, offset, 
                    StyleElementPeer.CLASSNAME_DEFAULT);
d529 3
a531 4
            Record row = (Record)rows.elementAt(i);

                SkinStyleElementValue obj1 = row2Object( row,1, CLASSNAME_DEFAULT );
  
d536 3
a538 1
            
a539 3
            Style obj2 = StylePeer
                .row2Object(row, offset2, 
                    StylePeer.CLASSNAME_DEFAULT);
d561 3
a563 1
            
a564 3
            StyleElement obj3 = StyleElementPeer
                .row2Object(row, offset3, 
                    StyleElementPeer.CLASSNAME_DEFAULT);
d619 3
a621 4
            Record row = (Record)rows.elementAt(i);

                SkinStyleElementValue obj1 = row2Object( row,1, CLASSNAME_DEFAULT );
  
d625 3
a627 1
            
a628 3
            Skin obj2 = SkinPeer
                .row2Object(row, offset2, 
                    SkinPeer.CLASSNAME_DEFAULT);
d651 3
a653 1
            
a654 3
            StyleElement obj3 = StyleElementPeer
                .row2Object(row, offset3, 
                    StyleElementPeer.CLASSNAME_DEFAULT);
d709 3
a711 4
            Record row = (Record)rows.elementAt(i);

                SkinStyleElementValue obj1 = row2Object( row,1, CLASSNAME_DEFAULT );
  
d715 3
a717 1
            
a718 3
            Skin obj2 = SkinPeer
                .row2Object(row, offset2, 
                    SkinPeer.CLASSNAME_DEFAULT);
d740 3
a742 1
            
a743 3
            Style obj3 = StylePeer
                .row2Object(row, offset3, 
                    StylePeer.CLASSNAME_DEFAULT);
d772 28
a799 2


@


1.1.2.10
log
@Latest Torque-generated code to handle inheritance based on values in a database field column.
@
text
@d26 1
a26 1
  * [Mon Feb 12 19:03:25 PST 2001]
d96 5
a100 5
                                            obj.setSkinId(row.getValue(offset+0).asInt());
                                                    obj.setStyleId(row.getValue(offset+1).asInt());
                                                    obj.setElementId(row.getValue(offset+2).asInt());
                                                    obj.setValue(row.getValue(offset+3).asString());
                                            obj.setModified(false);
a101 1

d222 1
a222 1
     * otherwise use the doDelete(Criteria) method.  It will take care of 
@


1.1.2.11
log
@Deprecated by Torque modificaitons.
@
text
@@


