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


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

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

1.1.2.2
date	2001.02.01.02.56.58;	author leonardr;	state Exp;
branches;
next	1.1.2.3;

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

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

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

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

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

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

1.1.2.9
date	2001.02.16.03.05.24;	author dlr;	state dead;
branches;
next	;


desc
@@


1.1
log
@file BaseRoleActionResource.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 224
package org.tigris.helm.om;

// JDK classes
import java.util.*;

// Turbine classes
import org.apache.turbine.om.BaseObject;
import org.apache.turbine.om.peer.BasePeer;
import org.tigris.helm.om.peer.*;
import org.apache.turbine.util.db.Criteria;
import org.apache.turbine.util.ObjectUtils;
import org.apache.turbine.util.Log;
import org.apache.turbine.util.db.pool.DBConnection;

/** 
 * This class was autogenerated by Torque on: Fri Jan 26 19:21:34 PST 2001
 * You should not use this class directly.  It should not even be
 * extended all references should be to RoleActionResource 
 */
abstract class BaseRoleActionResource extends BaseObject
{
    /** the value for the role_id field */
    private int role_id;
    /** the value for the action_id field */
    private int action_id;
    /** the value for the resource_id field */
    private int resource_id;


    /**
     * Get the RoleId
     * @@return int
     */
     public int getRoleId()
     {
          return role_id;
     }


    /**
     * Set the value of RoleId
     */
     public void setRoleId(int v ) 
     {


           if (this.role_id != v)
           {
              this.role_id = v;
              setModified(true);
          }
     }
    /**
     * Get the ActionId
     * @@return int
     */
     public int getActionId()
     {
          return action_id;
     }


    /**
     * Set the value of ActionId
     */
     public void setActionId(int v ) 
     {


           if (this.action_id != v)
           {
              this.action_id = v;
              setModified(true);
          }
     }
    /**
     * Get the ResourceId
     * @@return int
     */
     public int getResourceId()
     {
          return resource_id;
     }


    /**
     * Set the value of ResourceId
     */
     public void setResourceId(int v ) 
     {


           if (this.resource_id != v)
           {
              this.resource_id = v;
              setModified(true);
          }
     }

 
    
     	

    /**
     * Stores the object in the database.  If the object is new,
     * it inserts it; otherwise an update is performed.
     */
    public void save() throws Exception
    {
 
        if (isModified())
        {
            if (isNew())
            {
                RoleActionResourcePeer.doInsert((RoleActionResource)this);
                setNew(false);
            }
            else
            {
                RoleActionResourcePeer.doUpdate((RoleActionResource)this);
            }
        }
      
     }

      /**
     * Stores the object in the database.  If the object is new,
     * it inserts it; otherwise an update is performed.  This method
     * is meant to be used as part of a transaction, otherwise use
     * the save() method and the connection details will be handled
     * internally
     */
    public void save(DBConnection dbCon) throws Exception
    {
          if (isModified())
        {
            if (isNew())
            {
                RoleActionResourcePeer.doInsert((RoleActionResource)this, dbCon);
            }
            else
            {
                RoleActionResourcePeer.doUpdate((RoleActionResource)this, dbCon);
                setNew(false);
            }
        }

       }


    /** 
     * Set the Id using pk values.
     *
     * @@param int role_id
     * @@param int action_id
     * @@param int resource_id
     */
    public void setPrimaryKey(
                      int role_id
                                      , int action_id
                                      , int resource_id
                             ) 
    {
                     setRoleId(role_id);
                             setActionId(action_id);
                             setResourceId(resource_id);
                }

    /** 
     * Set the Id using a : separated String of pk values.
     */
    public void setPrimaryKey(Object id) throws Exception
    {
        StringTokenizer st = new StringTokenizer(id.toString(), ":");
                           setRoleId( Integer.parseInt(st.nextToken()) );
                                          setActionId( Integer.parseInt(st.nextToken()) );
                                          setResourceId( Integer.parseInt(st.nextToken()) );
                        }


    /** 
     * returns an id that differentiates this object from others
     * of its class.
     */
    public Object getPrimaryKey() 
    {
        return ""
                      + getRoleId()
                                      + ":"  + getActionId()
                                      + ":"  + getResourceId()
                             ;
    } 

    /** 
     * returns an id that can be used to specify this object in
     * a query string.
     */
    public String getQueryOID() 
    {
        return "RoleActionResource[" + getPrimaryKey() + "]";
    }

    /**
     * Makes a copy of this object.  
     * It creates a new object filling in the simple attributes.
      */
    public RoleActionResource copy() throws Exception
    {
        RoleActionResource copyObj = new RoleActionResource();
         copyObj.setRoleId(role_id);
         copyObj.setActionId(action_id);
         copyObj.setResourceId(resource_id);
 
  
                        
        copyObj.setRoleId(NEW_ID);
                              
        copyObj.setActionId(NEW_ID);
                              
        copyObj.setResourceId(NEW_ID);
           return copyObj;
    }             

}
@


1.1.2.2
log
@Changes to generated classes.
@
text
@d20 1
a20 1
public abstract class BaseRoleActionResource extends BaseObject
@


1.1.2.3
log
@Latest Torque generated code (simple object model).
@
text
@a4 1
import java.math.*;
d16 1
a16 1
 * This class was autogenerated by Torque on: Tue Feb 06 19:46:40 PST 2001
a101 36
    /**
     * Generate a Vector with field names.
     */
    static private Vector fieldNames_ = null;
    static public Vector getFieldNames()
    {
      if (fieldNames_ == null)
      {
        fieldNames_ = new Vector();
            fieldNames_.add("RoleId");
            fieldNames_.add("ActionId");
            fieldNames_.add("ResourceId");
          }
      return fieldNames_;
    }

    /**
     * Retrieves a field from the object by name passed in
     * as a String.
     */
    public Object getByName(String name)
    {
            if (name.equals("RoleId"))
	{
	  	    return new Integer(getRoleId());
	  	}
            if (name.equals("ActionId"))
	{
	  	    return new Integer(getActionId());
	  	}
            if (name.equals("ResourceId"))
	{
	  	    return new Integer(getResourceId());
	  	}
            return null; 
    }
d202 21
@


1.1.2.4
log
@Newest generated code (complex model this time).  Removed getUsers from Domain to side step decl conflict.
@
text
@d17 1
a17 1
 * This class was autogenerated by Torque on: Wed Feb 07 12:45:09 PST 2001
d40 1
a40 1
            
d44 1
a44 1
     public void setRoleId(int v ) throws Exception
d46 1
a46 7
                  if ( aRole != null && !aRole.isNew())
        {
            throw new Exception("Can't set a foreign key directly after an "
                + " association is already made based on saved data.");
        }
  
  
d63 1
a63 1
            
d67 1
a67 1
     public void setActionId(int v ) throws Exception
d69 1
a69 7
                  if ( aAction != null && !aAction.isNew())
        {
            throw new Exception("Can't set a foreign key directly after an "
                + " association is already made based on saved data.");
        }
  
  
d86 1
a86 1
            
d90 1
a90 1
     public void setResourceId(int v ) throws Exception
d92 1
a92 7
                  if ( aResource != null && !aResource.isNew())
        {
            throw new Exception("Can't set a foreign key directly after an "
                + " association is already made based on saved data.");
        }
  
  
a101 108
 
   
             
   
   
    /**
     * Declares an association between this object and a Role object
     *
     * @@param Role v
     */
    private Role aRole;
    public void setRole(Role v) throws Exception
    {
        aRole = null;
           setRoleId(v.getRoleId());
           aRole = v;
    }

                     
    public Role getRole() throws Exception
    {
        if ( aRole==null && (this.role_id>0) )
        {
            aRole = RolePeer.retrieveByPK(this.role_id);
            // The following can be used instead of the line above to
            // guarantee the related object contains a reference
            // to this object, but this level of coupling 
            // may be undesirable in many circumstances.
            // As it can lead to a db query with many results that may
            // never be used.  
            // Role obj = RolePeer.retrieveByPK(this.role_id);
            // obj.addRoleActionResources(this);
        }
        return aRole;
    }

 
   
             
   
   
    /**
     * Declares an association between this object and a Action object
     *
     * @@param Action v
     */
    private Action aAction;
    public void setAction(Action v) throws Exception
    {
        aAction = null;
           setActionId(v.getActionId());
           aAction = v;
    }

                     
    public Action getAction() throws Exception
    {
        if ( aAction==null && (this.action_id>0) )
        {
            aAction = ActionPeer.retrieveByPK(this.action_id);
            // The following can be used instead of the line above to
            // guarantee the related object contains a reference
            // to this object, but this level of coupling 
            // may be undesirable in many circumstances.
            // As it can lead to a db query with many results that may
            // never be used.  
            // Action obj = ActionPeer.retrieveByPK(this.action_id);
            // obj.addRoleActionResources(this);
        }
        return aAction;
    }

 
   
             
   
   
    /**
     * Declares an association between this object and a Resource object
     *
     * @@param Resource v
     */
    private Resource aResource;
    public void setResource(Resource v) throws Exception
    {
        aResource = null;
           setResourceId(v.getResourceId());
           aResource = v;
    }

                     
    public Resource getResource() throws Exception
    {
        if ( aResource==null && (this.resource_id>0) )
        {
            aResource = ResourcePeer.retrieveByPK(this.resource_id);
            // The following can be used instead of the line above to
            // guarantee the related object contains a reference
            // to this object, but this level of coupling 
            // may be undesirable in many circumstances.
            // As it can lead to a db query with many results that may
            // never be used.  
            // Resource obj = ResourcePeer.retrieveByPK(this.resource_id);
            // obj.addRoleActionResources(this);
        }
        return aResource;
    }

a102 4
        
    
    private static Vector fieldNames_ = null;

d104 1
a104 1
     * Generate a list of field names.
d106 2
a107 1
    public static Vector getFieldNames()
d147 2
a148 2
         DBConnection dbCon = null;
        try
d150 9
a158 9
            dbCon = BasePeer.beginTransaction(
                RoleActionResourcePeer.getMapBuilder()
                .getDatabaseMap().getName());
            save(dbCon);
        }
        catch(Exception e)
        {
            BasePeer.rollBackTransaction(dbCon);
            throw e;
d160 1
a160 2
        BasePeer.commitTransaction(dbCon);

a162 3
      // flag to prevent endless save loop, if this object is referenced
    // by another object which falls in this transaction.
    private boolean alreadyInSave = false;
a171 3
        if (!alreadyInSave)
      {
        alreadyInSave = true;
d185 2
a186 3
              alreadyInSave = false;
      }
      }
a187 1
                                                            
d199 1
a199 1
                             ) throws Exception
@


1.1.2.5
log
@Torque autogen files.
@
text
@d17 1
a17 4
 * This class was autogenerated by Torque on:
 *
 * [Thu Feb 08 17:56:55 PST 2001]
 *
@


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


1.1.2.7
log
@New Torque-generated classes.
@
text
@d19 1
a19 1
 * [Mon Feb 12 16:46:43 PST 2001]
@


1.1.2.8
log
@Latest Torque-generated code to handle inheritance based on values in a database field column.
@
text
@d19 1
a19 1
 * [Mon Feb 12 19:03:25 PST 2001]
@


1.1.2.9
log
@Deprecated by Torque modifications.
@
text
@@


