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

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

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

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

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

1.1.2.7
date	2001.02.07.02.23.55;	author leonardr;	state Exp;
branches;
next	1.1.2.8;

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

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

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

1.1.2.11
date	2001.02.09.23.25.42;	author dlr;	state Exp;
branches;
next	1.1.2.12;

1.1.2.12
date	2001.02.13.00.55.54;	author dlr;	state Exp;
branches;
next	1.1.2.13;

1.1.2.13
date	2001.02.13.03.03.05;	author dlr;	state Exp;
branches;
next	1.1.2.14;

1.1.2.14
date	2001.02.13.21.27.27;	author leonardr;	state Exp;
branches;
next	1.1.2.15;

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


desc
@@


1.1
log
@file BaseUserPeer.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 408
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.User;

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

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

    /** the column name for the USER_ID field */
    public static final String USER_ID = mapBuilder.getUser_UserId();
    /** the column name for the DOMAIN_ID field */
    public static final String DOMAIN_ID = mapBuilder.getUser_DomainId();
    /** the column name for the LOGIN_NAME field */
    public static final String LOGIN_NAME = mapBuilder.getUser_LoginName();
    /** the column name for the PASSWORD field */
    public static final String PASSWORD = mapBuilder.getUser_Password();
    /** the column name for the REAL_NAME field */
    public static final String REAL_NAME = mapBuilder.getUser_RealName();
    /** the column name for the ADDRESS1 field */
    public static final String ADDRESS1 = mapBuilder.getUser_Address1();
    /** the column name for the ADDRESS2 field */
    public static final String ADDRESS2 = mapBuilder.getUser_Address2();
    /** the column name for the CITY field */
    public static final String CITY = mapBuilder.getUser_City();
    /** the column name for the STATE field */
    public static final String STATE = mapBuilder.getUser_State();
    /** the column name for the POSTALCODE field */
    public static final String POSTALCODE = mapBuilder.getUser_Postalcode();
    /** the column name for the COUNTRY field */
    public static final String COUNTRY = mapBuilder.getUser_Country();
    /** the column name for the CITIZENSHIP field */
    public static final String CITIZENSHIP = mapBuilder.getUser_Citizenship();
    /** the column name for the PHONE field */
    public static final String PHONE = mapBuilder.getUser_Phone();
    /** the column name for the ALTPHONE field */
    public static final String ALTPHONE = mapBuilder.getUser_Altphone();
    /** the column name for the FAX field */
    public static final String FAX = mapBuilder.getUser_Fax();
    /** the column name for the CELL field */
    public static final String CELL = mapBuilder.getUser_Cell();
    /** the column name for the PAGER field */
    public static final String PAGER = mapBuilder.getUser_Pager();
    /** the column name for the EMAIL field */
    public static final String EMAIL = mapBuilder.getUser_Email();
    /** the column name for the ORGANIZATION field */
    public static final String ORGANIZATION = mapBuilder.getUser_Organization();
    /** the column name for the MODIFIED field */
    public static final String MODIFIED = mapBuilder.getUser_Modified();
    /** the column name for the CREATED field */
    public static final String CREATED = mapBuilder.getUser_Created();
    /** the column name for the TYPE field */
    public static final String TYPE = mapBuilder.getUser_Type();
    /** the column name for the PASSWORDTICKET field */
    public static final String PASSWORDTICKET = mapBuilder.getUser_Passwordticket();

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

    /** 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( USER_ID );
            criteria.addSelectColumn( DOMAIN_ID );
            criteria.addSelectColumn( LOGIN_NAME );
            criteria.addSelectColumn( PASSWORD );
            criteria.addSelectColumn( REAL_NAME );
            criteria.addSelectColumn( ADDRESS1 );
            criteria.addSelectColumn( ADDRESS2 );
            criteria.addSelectColumn( CITY );
            criteria.addSelectColumn( STATE );
            criteria.addSelectColumn( POSTALCODE );
            criteria.addSelectColumn( COUNTRY );
            criteria.addSelectColumn( CITIZENSHIP );
            criteria.addSelectColumn( PHONE );
            criteria.addSelectColumn( ALTPHONE );
            criteria.addSelectColumn( FAX );
            criteria.addSelectColumn( CELL );
            criteria.addSelectColumn( PAGER );
            criteria.addSelectColumn( EMAIL );
            criteria.addSelectColumn( ORGANIZATION );
            criteria.addSelectColumn( MODIFIED );
            criteria.addSelectColumn( CREATED );
            criteria.addSelectColumn( TYPE );
            criteria.addSelectColumn( PASSWORDTICKET );
        }


    /** 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 User row2Object (Record row, int offset, Class cls ) throws Exception
    {
        User obj = (User)cls.newInstance();
                                        obj.setUserId(row.getValue(offset+0).asInt());
                                            obj.setDomainId(row.getValue(offset+1).asInt());
                                            obj.setLoginName(row.getValue(offset+2).asString());
                                            obj.setPassword(row.getValue(offset+3).asString());
                                            obj.setRealName(row.getValue(offset+4).asString());
                                            obj.setAddress1(row.getValue(offset+5).asString());
                                            obj.setAddress2(row.getValue(offset+6).asString());
                                            obj.setCity(row.getValue(offset+7).asString());
                                            obj.setState(row.getValue(offset+8).asString());
                                            obj.setPostalcode(row.getValue(offset+9).asString());
                                            obj.setCountry(row.getValue(offset+10).asString());
                                            obj.setCitizenship(row.getValue(offset+11).asString());
                                            obj.setPhone(row.getValue(offset+12).asString());
                                            obj.setAltphone(row.getValue(offset+13).asString());
                                            obj.setFax(row.getValue(offset+14).asString());
                                            obj.setCell(row.getValue(offset+15).asString());
                                            obj.setPager(row.getValue(offset+16).asString());
                                            obj.setEmail(row.getValue(offset+17).asString());
                                            obj.setOrganization(row.getValue(offset+18).asString());
                                            obj.setModified(row.getValue(offset+19).asDate());
                                            obj.setCreated(row.getValue(offset+20).asDate());
                                            obj.setType(row.getValue(offset+21).asString());
                                            obj.setPasswordticket(row.getValue(offset+22).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.User", 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.User", 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( USER_ID, criteria.remove(USER_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( USER_ID, criteria.remove(USER_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( User 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(User obj) throws Exception
    {
        doUpdate(buildCriteria(obj));
    }
    /**
     * @@param obj the data object to delete in the database.
     */
    public static void doDelete(User obj) throws Exception
    {
        doDelete(buildCriteria(obj));
    }

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

    /** Build a Criteria object from the data object for this peer */
    public static Criteria buildCriteria( User obj )
    {
        Criteria criteria = new Criteria();
                            if ( !obj.isNew() )
	                criteria.add( USER_ID, obj.getUserId() );
                                criteria.add( DOMAIN_ID, obj.getDomainId() );
                                criteria.add( LOGIN_NAME, obj.getLoginName() );
                                criteria.add( PASSWORD, obj.getPassword() );
                                criteria.add( REAL_NAME, obj.getRealName() );
                                criteria.add( ADDRESS1, obj.getAddress1() );
                                criteria.add( ADDRESS2, obj.getAddress2() );
                                criteria.add( CITY, obj.getCity() );
                                criteria.add( STATE, obj.getState() );
                                criteria.add( POSTALCODE, obj.getPostalcode() );
                                criteria.add( COUNTRY, obj.getCountry() );
                                criteria.add( CITIZENSHIP, obj.getCitizenship() );
                                criteria.add( PHONE, obj.getPhone() );
                                criteria.add( ALTPHONE, obj.getAltphone() );
                                criteria.add( FAX, obj.getFax() );
                                criteria.add( CELL, obj.getCell() );
                                criteria.add( PAGER, obj.getPager() );
                                criteria.add( EMAIL, obj.getEmail() );
                                criteria.add( ORGANIZATION, obj.getOrganization() );
                                criteria.add( MODIFIED, obj.getModified() );
                                criteria.add( CREATED, obj.getCreated() );
                                criteria.add( TYPE, obj.getType() );
                                criteria.add( PASSWORDTICKET, obj.getPasswordticket() );
                return criteria;
    }

    /** 
     * Retrieve a single object by pk where multiple PK's are separated
     * by colons
     *
     * @@param int user_id
     */
    public static User 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 user_id = Integer.parseInt(stok.nextToken());;

       return retrieveByPK(
             user_id
              );
    }

    /** 
     * Retrieve a single object by pk
     *
     * @@param int user_id
     */
    public static User retrieveByPK(
                      int user_id
                                                                                                                                                                                                                                                                                                     ) throws Exception
    {
        Criteria criteria = new Criteria();
                       if( user_id > 0 )
                  criteria.add( BaseUserPeer.USER_ID, user_id );
                                                                                                                                                                                                                       Vector UserVector = doSelect(criteria);
        if (UserVector.size() != 1)
        {
            throw new Exception("Failed to select one and only one row.");
        }
        else
        {
            return (User) UserVector.firstElement();
        }
    }


}








@


1.1.2.2
log
@Name should be two parts.
@
text
@d77 1
a77 1
    public static final String PASSWORD_TICKET = mapBuilder.getUser_PasswordTicket();
d125 1
a125 1
            criteria.addSelectColumn( PASSWORD_TICKET );
d159 1
a159 1
                                            obj.setPasswordTicket(row.getValue(offset+22).asString());
@


1.1.2.3
log
@Name should be two parts.
@
text
@d350 1
a350 1
                                criteria.add( PASSWORD_TICKET, obj.getPasswordticket() );
@


1.1.2.4
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 BaseUserPeer extends BasePeer
@


1.1.2.5
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 */
d76 1
a76 1
    /** the column name for the PASSWORD_TICKET field */
d85 1
a85 1
        criteria.setDbName(mapBuilder.getDatabaseMap().getName());
d96 1
a96 1
        criteria.setDbName(mapBuilder.getDatabaseMap().getName());
d168 1
a168 1
        criteria.setDbName(mapBuilder.getDatabaseMap().getName());
d179 1
a179 1
        criteria.setDbName(mapBuilder.getDatabaseMap().getName());
d220 1
a220 1
        criteria.setDbName(mapBuilder.getDatabaseMap().getName());
d235 1
a235 1
         criteria.setDbName(mapBuilder.getDatabaseMap().getName());
d248 1
a248 1
         criteria.setDbName(mapBuilder.getDatabaseMap().getName());
d261 1
a261 1
         criteria.setDbName(mapBuilder.getDatabaseMap().getName());
d350 1
a350 1
                                criteria.add( PASSWORD_TICKET, obj.getPasswordTicket() );
d387 1
a387 1
                  criteria.add( UserPeer.USER_ID, user_id );
@


1.1.2.6
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.7
log
@Ported UserAdd servlet.
@
text
@d24 1
a24 1
abstract public class BaseUserPeer extends BasePeer
@


1.1.2.8
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 BaseUserPeer extends BasePeer
d222 1
a222 2
        Criteria selectCriteria = new
            Criteria(mapBuilder.getDatabaseMap().getName(), 2);
d236 2
a237 3
        criteria.setDbName(mapBuilder.getDatabaseMap().getName());
        Criteria selectCriteria = new
            Criteria(mapBuilder.getDatabaseMap().getName(), 2);
@


1.1.2.9
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 */
a402 71
     
        
                       
     
          


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

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

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

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

        }

        return results;
    }
    

  


    
    /** 
     * Retrieve objects by fk
     *
     * @@param int domain_id
     */
//    public static Vector retrieveByDomainId(int domain_id)
//    {
        
                                            
@


1.1.2.10
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.11
log
@New Torque-generated classes.  NewsItem replaces ProjectNews.
@
text
@d26 1
a26 1
  * [Fri Feb 09 15:29:27 PST 2001]
@


1.1.2.12
log
@New Torque-generated classes.
@
text
@d26 1
a26 1
  * [Mon Feb 12 16:46:43 PST 2001]
d80 2
d86 1
a86 5
    public static final int numColumns =  22;

    /** A class that can be returned by this peer. */
    protected static final String CLASSNAME_DEFAULT = 
        "org.tigris.helm.om.User";
a87 29
    /** the column name for the TYPE field */
    public static final String TYPE = mapBuilder.getUser_Type();

                                    
            /** A key representing a particular subclass */
    protected static final String CLASSKEY_GROUP = 
        "group";

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

            /** A key representing a particular subclass */
    protected static final String CLASSKEY_DOMAIN = 
        "domain";

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

            /** A key representing a particular subclass */
    protected static final String CLASSKEY_HOST = 
        "host";

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

            
d92 1
a92 1
                                                                                                                                                                                                                                                                                                                                 return BasePeer.doInsert( criteria );
d103 1
a103 1
                                                                                                                                                                                                                                                                                                                                 return BasePeer.doInsert( criteria, dbCon );
d130 1
d135 32
a166 36
    /** 
     * 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 User row2Object (Record row, 
                                              int offset, 
                                              String cls ) 
        throws Exception
    {
        User obj = 
            (User)Class.forName(cls).newInstance();
                                                        obj.setUserId(row.getValue(offset+0).asInt());
                                                                            obj.setDomainId(row.getValue(offset+1).asInt());
                                                                            obj.setLoginName(row.getValue(offset+2).asString());
                                                                            obj.setPassword(row.getValue(offset+3).asString());
                                                                            obj.setRealName(row.getValue(offset+4).asString());
                                                                            obj.setAddress1(row.getValue(offset+5).asString());
                                                                            obj.setAddress2(row.getValue(offset+6).asString());
                                                                            obj.setCity(row.getValue(offset+7).asString());
                                                                            obj.setState(row.getValue(offset+8).asString());
                                                                            obj.setPostalcode(row.getValue(offset+9).asString());
                                                                            obj.setCountry(row.getValue(offset+10).asString());
                                                                            obj.setCitizenship(row.getValue(offset+11).asString());
                                                                            obj.setPhone(row.getValue(offset+12).asString());
                                                                            obj.setAltphone(row.getValue(offset+13).asString());
                                                                            obj.setFax(row.getValue(offset+14).asString());
                                                                            obj.setCell(row.getValue(offset+15).asString());
                                                                            obj.setPager(row.getValue(offset+16).asString());
                                                                            obj.setEmail(row.getValue(offset+17).asString());
                                                                            obj.setOrganization(row.getValue(offset+18).asString());
                                                                            obj.setModified(row.getValue(offset+19).asDate());
                                                                            obj.setCreated(row.getValue(offset+20).asDate());
                                                                            obj.setPasswordTicket(row.getValue(offset+21).asString());
                                                        obj.setModified(false);
d174 2
a175 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) ); 
d179 3
a181 2
     * Grabs the raw Village records to be formed into objects.
     * This method handles connections internally 
d183 1
a183 2
    public static Vector doSelectVillageRecords( Criteria criteria ) 
        throws Exception
d186 1
a186 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);
d189 4
a192 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
d196 1
a196 1
                                                                                                                                                                                                                                                                                                                         
d199 10
a208 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());
d211 1
a211 1
        for ( int i=0; i<records.size(); i++ )
d213 4
a216 24
            Record row = (Record)records.elementAt(i);

                String className = null;
            String classKey = row.getValue(TYPE)
                .asString();
                                        if (CLASSKEY_GROUP.equals(classKey))
                        {
                className = CLASSNAME_GROUP;
            }
                                            else if (CLASSKEY_DOMAIN.equals(classKey))
                        {
                className = CLASSNAME_DOMAIN;
            }
                                            else if (CLASSKEY_HOST.equals(classKey))
                        {
                className = CLASSNAME_HOST;
            }
                                else
            {
                className = CLASSNAME_DEFAULT;
            }
            results.add(row2Object( row, 1, className ));
            }
        return results;
d230 1
a230 1
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          BasePeer.doUpdate( selectCriteria, criteria );
d246 1
a246 1
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          BasePeer.doUpdate( selectCriteria, criteria, dbCon );
d257 1
a257 1
                                                                                                                                                                                                                                                                                                                                  BasePeer.doDelete ( criteria );
d270 1
a270 1
                                                                                                                                                                                                                                                                                                                                  BasePeer.doDelete ( criteria, dbCon );
d357 1
d391 1
a391 1
                                                                                                                                                                                                                                                                                         ) throws Exception
d396 1
a396 1
                                                                                                                                                                                                              Vector UserVector = doSelect(criteria);
d428 1
a428 1
                                                                                                                                                                                                                                                                                                                                 
d434 3
a436 24
            Record row = (Record)rows.elementAt(i);

                String className = null;
                        String classKey = row.getValue(TYPE)
                .asString();
                                        if (CLASSKEY_GROUP.equals(classKey))
                        {
                className = CLASSNAME_GROUP;
            }
                                            else if (CLASSKEY_DOMAIN.equals(classKey))
                        {
                className = CLASSNAME_DOMAIN;
            }
                                            else if (CLASSKEY_HOST.equals(classKey))
                        {
                className = CLASSNAME_HOST;
            }
                                else
            {
                className = CLASSNAME_DEFAULT;
            }
            User obj1 = row2Object( row, 1, className );
    

d438 2
a439 2
                .row2Object(row, offset, 
                    DomainPeer.CLASSNAME_DEFAULT);
d469 10
a478 2


@


1.1.2.13
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]
a79 2
    /** the column name for the TYPE field */
    public static final String TYPE = mapBuilder.getUser_Type();
d84 1
a84 1
    public static final int numColumns =  23;
d90 2
d95 1
a95 1
    public static final String CLASSKEY_GROUP = 
d99 1
a99 1
    public static final String CLASSNAME_GROUP = 
d103 1
a103 1
    public static final String CLASSKEY_DOMAIN = 
d107 1
a107 1
    public static final String CLASSNAME_DOMAIN = 
d111 1
a111 1
    public static final String CLASSKEY_HOST = 
d115 1
a115 1
    public static final String CLASSNAME_HOST = 
d123 1
a123 1
                                                                                                                                                                                                                                                                                                                                               return BasePeer.doInsert( criteria );
d134 1
a134 1
                                                                                                                                                                                                                                                                                                                                               return BasePeer.doInsert( criteria, dbCon );
a160 1
            criteria.addSelectColumn( TYPE );
d178 23
a200 24
                                            obj.setUserId(row.getValue(offset+0).asInt());
                                                    obj.setDomainId(row.getValue(offset+1).asInt());
                                                    obj.setLoginName(row.getValue(offset+2).asString());
                                                    obj.setPassword(row.getValue(offset+3).asString());
                                                    obj.setRealName(row.getValue(offset+4).asString());
                                                    obj.setAddress1(row.getValue(offset+5).asString());
                                                    obj.setAddress2(row.getValue(offset+6).asString());
                                                    obj.setCity(row.getValue(offset+7).asString());
                                                    obj.setState(row.getValue(offset+8).asString());
                                                    obj.setPostalcode(row.getValue(offset+9).asString());
                                                    obj.setCountry(row.getValue(offset+10).asString());
                                                    obj.setCitizenship(row.getValue(offset+11).asString());
                                                    obj.setPhone(row.getValue(offset+12).asString());
                                                    obj.setAltphone(row.getValue(offset+13).asString());
                                                    obj.setFax(row.getValue(offset+14).asString());
                                                    obj.setCell(row.getValue(offset+15).asString());
                                                    obj.setPager(row.getValue(offset+16).asString());
                                                    obj.setEmail(row.getValue(offset+17).asString());
                                                    obj.setOrganization(row.getValue(offset+18).asString());
                                                    obj.setModified(row.getValue(offset+19).asDate());
                                                    obj.setCreated(row.getValue(offset+20).asDate());
                                                    obj.setType(row.getValue(offset+21).asString());
                                                    obj.setPasswordTicket(row.getValue(offset+22).asString());
                                            obj.setModified(false);
a201 1

d233 1
a233 1
                                                                                                                                                                                                                                                                                                                                       
d250 1
a250 1
                                                                                                                                                                                                                                                                                                                                       
d305 1
a305 1
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 BasePeer.doUpdate( selectCriteria, criteria );
d321 1
a321 1
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 BasePeer.doUpdate( selectCriteria, criteria, dbCon );
d332 1
a332 1
                                                                                                                                                                                                                                                                                                                                                BasePeer.doDelete ( criteria );
d337 1
a337 1
     * otherwise use the doDelete(Criteria) method.  It will take care of 
d345 1
a345 1
                                                                                                                                                                                                                                                                                                                                                BasePeer.doDelete ( criteria, dbCon );
d411 1
a411 1
    	                criteria.add( USER_ID, obj.getUserId() );
a431 1
                                criteria.add( TYPE, obj.getType() );
d465 1
a465 1
                                                                                                                                                                                                                                                                                                     ) throws Exception
d470 1
a470 1
                                                                                                                                                                                                                       Vector UserVector = doSelect(criteria);
d502 1
a502 1
                                                                                                                                                                                                                                                                                                                                               
@


1.1.2.14
log
@Hand-fixed incorrect generated code. dlr is working on getting better code generated
@
text
@d108 1
a108 1
        "org.tigris.helm.om.DomainUserGroup";
d116 1
a116 1
        "org.tigris.helm.om.HostUserGroup";
@


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


