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.52;	author dlr;	state Exp;
branches;
next	1.1.2.8;

1.1.2.8
date	2001.02.09.23.31.19;	author dlr;	state dead;
branches;
next	;


desc
@@


1.1
log
@file BaseProjectNewsPeer.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 343
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.ProjectNews;

// 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 BaseProjectNewsPeer extends BasePeer
{
    /** the mapbuilder for this class */
    private static final ProjectNewsMapBuilder mapBuilder = 
        (ProjectNewsMapBuilder)getMapBuilder(ProjectNewsMapBuilder.CLASS_NAME);

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

    /** the column name for the NEWS_ID field */
    public static final String NEWS_ID = mapBuilder.getProjectNews_NewsId();
    /** the column name for the PROJECT_ID field */
    public static final String PROJECT_ID = mapBuilder.getProjectNews_ProjectId();
    /** the column name for the EVENT_DATE field */
    public static final String EVENT_DATE = mapBuilder.getProjectNews_EventDate();
    /** the column name for the HEADLINE field */
    public static final String HEADLINE = mapBuilder.getProjectNews_Headline();
    /** the column name for the BODY field */
    public static final String BODY = mapBuilder.getProjectNews_Body();
    /** the column name for the PROPOSED_BY field */
    public static final String PROPOSED_BY = mapBuilder.getProjectNews_ProposedBy();
    /** the column name for the APPROVED_BY field */
    public static final String APPROVED_BY = mapBuilder.getProjectNews_ApprovedBy();
    /** the column name for the PUBLISH_ON field */
    public static final String PUBLISH_ON = mapBuilder.getProjectNews_PublishOn();
    /** the column name for the REMOVE_ON field */
    public static final String REMOVE_ON = mapBuilder.getProjectNews_RemoveOn();
    /** the column name for the PRIORITY field */
    public static final String PRIORITY = mapBuilder.getProjectNews_Priority();

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

    /** 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( NEWS_ID );
            criteria.addSelectColumn( PROJECT_ID );
            criteria.addSelectColumn( EVENT_DATE );
            criteria.addSelectColumn( HEADLINE );
            criteria.addSelectColumn( BODY );
            criteria.addSelectColumn( PROPOSED_BY );
            criteria.addSelectColumn( APPROVED_BY );
            criteria.addSelectColumn( PUBLISH_ON );
            criteria.addSelectColumn( REMOVE_ON );
            criteria.addSelectColumn( PRIORITY );
        }


    /** 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 ProjectNews row2Object (Record row, int offset, Class cls ) throws Exception
    {
        ProjectNews obj = (ProjectNews)cls.newInstance();
                                        obj.setNewsId(row.getValue(offset+0).asInt());
                                            obj.setProjectId(row.getValue(offset+1).asInt());
                                            obj.setEventDate(row.getValue(offset+2).asDate());
                                            obj.setHeadline(row.getValue(offset+3).asString());
                                            obj.setBody(row.getValue(offset+4).asString());
                                            obj.setProposedBy(row.getValue(offset+5).asInt());
                                            obj.setApprovedBy(row.getValue(offset+6).asInt());
                                            obj.setPublishOn(row.getValue(offset+7).asDate());
                                            obj.setRemoveOn(row.getValue(offset+8).asDate());
                                            obj.setPriority(row.getValue(offset+9).asInt());
                                        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.ProjectNews", 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.ProjectNews", 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( NEWS_ID, criteria.remove(NEWS_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( NEWS_ID, criteria.remove(NEWS_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( ProjectNews 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(ProjectNews obj) throws Exception
    {
        doUpdate(buildCriteria(obj));
    }
    /**
     * @@param obj the data object to delete in the database.
     */
    public static void doDelete(ProjectNews obj) throws Exception
    {
        doDelete(buildCriteria(obj));
    }

    /** 
     * Method to do inserts.  This method is to be used during a transaction,
     * otherwise use the doInsert(ProjectNews) method.  It will take 
     * care of the connection details internally. 
     *
     * @@param obj the data object to insert into the database.
     */
    public static void doInsert( ProjectNews 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(ProjectNews) method.  It will take 
     * care of the connection details internally. 
     *
     * @@param obj the data object to update in the database.
     */
    public static void doUpdate(ProjectNews 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(ProjectNews) method.  It will take 
     * care of the connection details internally. 
     *
     * @@param obj the data object to delete in the database.
     */
    public static void doDelete(ProjectNews obj, DBConnection dbCon) throws Exception
    {
        doDelete(buildCriteria(obj), dbCon);
    }

    /** Build a Criteria object from the data object for this peer */
    public static Criteria buildCriteria( ProjectNews obj )
    {
        Criteria criteria = new Criteria();
                            if ( !obj.isNew() )
	                criteria.add( NEWS_ID, obj.getNewsId() );
                                criteria.add( PROJECT_ID, obj.getProjectId() );
                                criteria.add( EVENT_DATE, obj.getEventDate() );
                                criteria.add( HEADLINE, obj.getHeadline() );
                                criteria.add( BODY, obj.getBody() );
                                criteria.add( PROPOSED_BY, obj.getProposedBy() );
                                criteria.add( APPROVED_BY, obj.getApprovedBy() );
                                criteria.add( PUBLISH_ON, obj.getPublishOn() );
                                criteria.add( REMOVE_ON, obj.getRemoveOn() );
                                criteria.add( PRIORITY, obj.getPriority() );
                return criteria;
    }

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

       return retrieveByPK(
             news_id
              );
    }

    /** 
     * Retrieve a single object by pk
     *
     * @@param int news_id
     */
    public static ProjectNews retrieveByPK(
                      int news_id
                                                                                                                                         ) throws Exception
    {
        Criteria criteria = new Criteria();
                       if( news_id > 0 )
                  criteria.add( BaseProjectNewsPeer.NEWS_ID, news_id );
                                                                                                  Vector ProjectNewsVector = doSelect(criteria);
        if (ProjectNewsVector.size() != 1)
        {
            throw new Exception("Failed to select one and only one row.");
        }
        else
        {
            return (ProjectNews) ProjectNewsVector.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 BaseProjectNewsPeer 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 */
d59 1
a59 1
        criteria.setDbName(mapBuilder.getDatabaseMap().getName());
d70 1
a70 1
        criteria.setDbName(mapBuilder.getDatabaseMap().getName());
d116 1
a116 1
        criteria.setDbName(mapBuilder.getDatabaseMap().getName());
d127 1
a127 1
        criteria.setDbName(mapBuilder.getDatabaseMap().getName());
d168 1
a168 1
        criteria.setDbName(mapBuilder.getDatabaseMap().getName());
d183 1
a183 1
         criteria.setDbName(mapBuilder.getDatabaseMap().getName());
d196 1
a196 1
         criteria.setDbName(mapBuilder.getDatabaseMap().getName());
d209 1
a209 1
         criteria.setDbName(mapBuilder.getDatabaseMap().getName());
d322 1
a322 1
                  criteria.add( ProjectNewsPeer.NEWS_ID, news_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 */
@


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 BaseProjectNewsPeer extends BasePeer
d170 1
a170 2
        Criteria selectCriteria = new
            Criteria(mapBuilder.getDatabaseMap().getName(), 2);
d184 2
a185 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 */
a337 418
       
        
                       
     
          


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

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

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

        for (int i=0; i<rows.size(); i++)
        {
            ProjectNews obj1 = 
                row2Object((com.workingdogs.village.Record)rows.elementAt(i),
                            1, Class.forName("org.tigris.helm.om.ProjectNews") );
            Project obj2 = ProjectPeer
                .row2Object((com.workingdogs.village.Record)rows.elementAt(i),
                            offset, Class.forName("org.tigris.helm.om.Project") );
            
            boolean newObject = true;
            for (int j=0; j<results.size(); j++)
            {
                ProjectNews temp_obj1 = (ProjectNews)results.elementAt(j);
                Project temp_obj2 = temp_obj1.getProject();
                if ( temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey() ) )
                {
                    newObject = false;
                    temp_obj2.addProjectNewss(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj2.initProjectNewss();
                obj2.addProjectNewss(obj1);
            }
            results.add(obj1);

        }

        return results;
    }
         
                               
     
          


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

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

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

        for (int i=0; i<rows.size(); i++)
        {
            ProjectNews obj1 = 
                row2Object((com.workingdogs.village.Record)rows.elementAt(i),
                            1, Class.forName("org.tigris.helm.om.ProjectNews") );
            User obj2 = UserPeer
                .row2Object((com.workingdogs.village.Record)rows.elementAt(i),
                            offset, Class.forName("org.tigris.helm.om.User") );
            
            boolean newObject = true;
            for (int j=0; j<results.size(); j++)
            {
                ProjectNews temp_obj1 = (ProjectNews)results.elementAt(j);
                User temp_obj2 = temp_obj1.getUserRelatedByProposedBy();
                if ( temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey() ) )
                {
                    newObject = false;
                    temp_obj2.addProjectNewssRelatedByProposedBy(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj2.initProjectNewssRelatedByProposedBy();
                obj2.addProjectNewssRelatedByProposedBy(obj1);
            }
            results.add(obj1);

        }

        return results;
    }
         
                               
     
          


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

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

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

        for (int i=0; i<rows.size(); i++)
        {
            ProjectNews obj1 = 
                row2Object((com.workingdogs.village.Record)rows.elementAt(i),
                            1, Class.forName("org.tigris.helm.om.ProjectNews") );
            User obj2 = UserPeer
                .row2Object((com.workingdogs.village.Record)rows.elementAt(i),
                            offset, Class.forName("org.tigris.helm.om.User") );
            
            boolean newObject = true;
            for (int j=0; j<results.size(); j++)
            {
                ProjectNews temp_obj1 = (ProjectNews)results.elementAt(j);
                User temp_obj2 = temp_obj1.getUserRelatedByApprovedBy();
                if ( temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey() ) )
                {
                    newObject = false;
                    temp_obj2.addProjectNewssRelatedByApprovedBy(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj2.initProjectNewssRelatedByApprovedBy();
                obj2.addProjectNewssRelatedByApprovedBy(obj1);
            }
            results.add(obj1);

        }

        return results;
    }
    

  
  
     
                       
          


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

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

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

            
             boolean  newObject = true;
            for (int j=0; j<results.size(); j++)
            {
                ProjectNews temp_obj1 = (ProjectNews)results.elementAt(j);
                User temp_obj2 = temp_obj1.getUserRelatedByProposedBy();
                if ( temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey() ) )
                {
                    newObject = false;
                    temp_obj2.addProjectNewssRelatedByProposedBy(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj2.initProjectNewssRelatedByProposedBy();
                obj2.addProjectNewssRelatedByProposedBy(obj1);
            }
                        
                                                                
                        
                        User obj3 = UserPeer
                .row2Object((com.workingdogs.village.Record)rows.elementAt(i),
                            offset3, Class.forName("org.tigris.helm.om.User") );

            
             newObject = true;
            for (int j=0; j<results.size(); j++)
            {
                ProjectNews temp_obj1 = (ProjectNews)results.elementAt(j);
                User temp_obj3 = temp_obj1.getUserRelatedByApprovedBy();
                if ( temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey() ) )
                {
                    newObject = false;
                    temp_obj3.addProjectNewssRelatedByApprovedBy(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj3.initProjectNewssRelatedByApprovedBy();
                obj3.addProjectNewssRelatedByApprovedBy(obj1);
            }
                        results.add(obj1);

        }

        return results;
    }
 
     
                               
          


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

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

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

            
             boolean  newObject = true;
            for (int j=0; j<results.size(); j++)
            {
                ProjectNews temp_obj1 = (ProjectNews)results.elementAt(j);
                Project temp_obj2 = temp_obj1.getProject();
                if ( temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey() ) )
                {
                    newObject = false;
                    temp_obj2.addProjectNewss(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj2.initProjectNewss();
                obj2.addProjectNewss(obj1);
            }
                        
                                  
                                  results.add(obj1);

        }

        return results;
    }
 
     
                               
          


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

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

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

            
             boolean  newObject = true;
            for (int j=0; j<results.size(); j++)
            {
                ProjectNews temp_obj1 = (ProjectNews)results.elementAt(j);
                Project temp_obj2 = temp_obj1.getProject();
                if ( temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey() ) )
                {
                    newObject = false;
                    temp_obj2.addProjectNewss(obj1);
                    break;
                }
            }
            if (newObject)
            {
                obj2.initProjectNewss();
                obj2.addProjectNewss(obj1);
            }
                        
                                  
                                  results.add(obj1);

        }

        return results;
    }
  


    
    /** 
     * Retrieve objects by fk
     *
     * @@param int project_id
     */
//    public static Vector retrieveByProjectId(int project_id)
//    {
        
          
    /** 
     * Retrieve objects by fk
     *
     * @@param int proposed_by
     */
//    public static Vector retrieveByProposedBy(int proposed_by)
//    {
        
    
    /** 
     * Retrieve objects by fk
     *
     * @@param int approved_by
     */
//    public static Vector retrieveByApprovedBy(int approved_by)
//    {
        
        
@


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
@No longer used.
@
text
@@


