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 BaseProjectDownload.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 418
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 ProjectDownload 
 */
abstract class BaseProjectDownload extends BaseObject
{
    /** the value for the download_id field */
    private int download_id;
    /** the value for the project_id field */
    private int project_id;
    /** the value for the file_name field */
    private String file_name;
    /** the value for the location field */
    private String location;
    /** the value for the suggested_by field */
    private int suggested_by;
    /** the value for the approved_by field */
    private int approved_by;
    /** the value for the is_public field */
    private String is_public;
    /** the value for the description field */
    private String description;
    /** the value for the uploaded_date field */
    private Date uploaded_date;
    /** the value for the size field */
    private long size;
    /** the value for the md5 field */
    private String md5;


    /**
     * Get the DownloadId
     * @@return int
     */
     public int getDownloadId()
     {
          return download_id;
     }


    /**
     * Set the value of DownloadId
     */
     public void setDownloadId(int v ) 
     {


           if (this.download_id != v)
           {
              this.download_id = v;
              setModified(true);
          }
     }
    /**
     * Get the ProjectId
     * @@return int
     */
     public int getProjectId()
     {
          return project_id;
     }


    /**
     * Set the value of ProjectId
     */
     public void setProjectId(int v ) 
     {


           if (this.project_id != v)
           {
              this.project_id = v;
              setModified(true);
          }
     }
    /**
     * Get the FileName
     * @@return String
     */
     public String getFileName()
     {
          return file_name;
     }


    /**
     * Set the value of FileName
     */
     public void setFileName(String v ) 
     {


           if ( !ObjectUtils.equals(this.file_name, v) )
           {
              this.file_name = v;
              setModified(true);
          }
     }
    /**
     * Get the Location
     * @@return String
     */
     public String getLocation()
     {
          return location;
     }


    /**
     * Set the value of Location
     */
     public void setLocation(String v ) 
     {


           if ( !ObjectUtils.equals(this.location, v) )
           {
              this.location = v;
              setModified(true);
          }
     }
    /**
     * Get the SuggestedBy
     * @@return int
     */
     public int getSuggestedBy()
     {
          return suggested_by;
     }


    /**
     * Set the value of SuggestedBy
     */
     public void setSuggestedBy(int v ) 
     {


           if (this.suggested_by != v)
           {
              this.suggested_by = v;
              setModified(true);
          }
     }
    /**
     * Get the ApprovedBy
     * @@return int
     */
     public int getApprovedBy()
     {
          return approved_by;
     }


    /**
     * Set the value of ApprovedBy
     */
     public void setApprovedBy(int v ) 
     {


           if (this.approved_by != v)
           {
              this.approved_by = v;
              setModified(true);
          }
     }
    /**
     * Get the IsPublic
     * @@return String
     */
     public String getIsPublic()
     {
          return is_public;
     }


    /**
     * Set the value of IsPublic
     */
     public void setIsPublic(String v ) 
     {


           if ( !ObjectUtils.equals(this.is_public, v) )
           {
              this.is_public = v;
              setModified(true);
          }
     }
    /**
     * Get the Description
     * @@return String
     */
     public String getDescription()
     {
          return description;
     }


    /**
     * Set the value of Description
     */
     public void setDescription(String v ) 
     {


           if ( !ObjectUtils.equals(this.description, v) )
           {
              this.description = v;
              setModified(true);
          }
     }
    /**
     * Get the UploadedDate
     * @@return Date
     */
     public Date getUploadedDate()
     {
          return uploaded_date;
     }


    /**
     * Set the value of UploadedDate
     */
     public void setUploadedDate(Date v ) 
     {


           if ( !ObjectUtils.equals(this.uploaded_date, v) )
           {
              this.uploaded_date = v;
              setModified(true);
          }
     }
    /**
     * Get the Size
     * @@return long
     */
     public long getSize()
     {
          return size;
     }


    /**
     * Set the value of Size
     */
     public void setSize(long v ) 
     {


           if (this.size != v)
           {
              this.size = v;
              setModified(true);
          }
     }
    /**
     * Get the Md5
     * @@return String
     */
     public String getMd5()
     {
          return md5;
     }


    /**
     * Set the value of Md5
     */
     public void setMd5(String v ) 
     {


           if ( !ObjectUtils.equals(this.md5, v) )
           {
              this.md5 = 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())
            {
                ProjectDownloadPeer.doInsert((ProjectDownload)this);
                setNew(false);
            }
            else
            {
                ProjectDownloadPeer.doUpdate((ProjectDownload)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())
            {
                ProjectDownloadPeer.doInsert((ProjectDownload)this, dbCon);
            }
            else
            {
                ProjectDownloadPeer.doUpdate((ProjectDownload)this, dbCon);
                setNew(false);
            }
        }

       }


    /** 
     * Set the Id using pk values.
     *
     * @@param int download_id
     */
    public void setPrimaryKey(
                      int download_id
                                                                                                                                                     ) 
    {
                     setDownloadId(download_id);
                                                                                                                                        }

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


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

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

    /**
     * Makes a copy of this object.  
     * It creates a new object filling in the simple attributes.
      */
    public ProjectDownload copy() throws Exception
    {
        ProjectDownload copyObj = new ProjectDownload();
         copyObj.setDownloadId(download_id);
         copyObj.setProjectId(project_id);
         copyObj.setFileName(file_name);
         copyObj.setLocation(location);
         copyObj.setSuggestedBy(suggested_by);
         copyObj.setApprovedBy(approved_by);
         copyObj.setIsPublic(is_public);
         copyObj.setDescription(description);
         copyObj.setUploadedDate(uploaded_date);
         copyObj.setSize(size);
         copyObj.setMd5(md5);
 
  
                        
        copyObj.setDownloadId(NEW_ID);
                                                                                 return copyObj;
    }             

}
@


1.1.2.2
log
@Changes to generated classes.
@
text
@d20 1
a20 1
public abstract class BaseProjectDownload 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
a301 76
    /**
     * Generate a Vector with field names.
     */
    static private Vector fieldNames_ = null;
    static public Vector getFieldNames()
    {
      if (fieldNames_ == null)
      {
        fieldNames_ = new Vector();
            fieldNames_.add("DownloadId");
            fieldNames_.add("ProjectId");
            fieldNames_.add("FileName");
            fieldNames_.add("Location");
            fieldNames_.add("SuggestedBy");
            fieldNames_.add("ApprovedBy");
            fieldNames_.add("IsPublic");
            fieldNames_.add("Description");
            fieldNames_.add("UploadedDate");
            fieldNames_.add("Size");
            fieldNames_.add("Md5");
          }
      return fieldNames_;
    }

    /**
     * Retrieves a field from the object by name passed in
     * as a String.
     */
    public Object getByName(String name)
    {
            if (name.equals("DownloadId"))
	{
	  	    return new Integer(getDownloadId());
	  	}
            if (name.equals("ProjectId"))
	{
	  	    return new Integer(getProjectId());
	  	}
            if (name.equals("FileName"))
	{
	  	    return getFileName();
	  	}
            if (name.equals("Location"))
	{
	  	    return getLocation();
	  	}
            if (name.equals("SuggestedBy"))
	{
	  	    return new Integer(getSuggestedBy());
	  	}
            if (name.equals("ApprovedBy"))
	{
	  	    return new Integer(getApprovedBy());
	  	}
            if (name.equals("IsPublic"))
	{
	  	    return getIsPublic();
	  	}
            if (name.equals("Description"))
	{
	  	    return getDescription();
	  	}
            if (name.equals("UploadedDate"))
	{
	  	    return getUploadedDate();
	  	}
            if (name.equals("Size"))
	{
	  	    return new Long(getSize());
	  	}
            if (name.equals("Md5"))
	{
	  	    return getMd5();
	  	}
            return null; 
    }
d413 1
a413 1
                       
d417 1
@


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
d56 1
a56 1
        
d62 1
a62 2
  
  
d79 1
a79 1
            
d83 1
a83 1
     public void setProjectId(int v ) throws Exception
d85 1
a85 7
                  if ( aProject != null && !aProject.isNew())
        {
            throw new Exception("Can't set a foreign key directly after an "
                + " association is already made based on saved data.");
        }
  
  
d102 1
a102 1
        
d108 1
a108 2
  
  
d125 1
a125 1
        
d131 1
a131 2
  
  
d148 1
a148 1
            
d152 1
a152 1
     public void setSuggestedBy(int v ) throws Exception
d154 1
a154 7
                  if ( aUserRelatedBySuggestedBy != null && !aUserRelatedBySuggestedBy.isNew())
        {
            throw new Exception("Can't set a foreign key directly after an "
                + " association is already made based on saved data.");
        }
  
  
d171 1
a171 1
            
d175 1
a175 1
     public void setApprovedBy(int v ) throws Exception
d177 1
a177 7
                  if ( aUserRelatedByApprovedBy != null && !aUserRelatedByApprovedBy.isNew())
        {
            throw new Exception("Can't set a foreign key directly after an "
                + " association is already made based on saved data.");
        }
  
  
d194 1
a194 1
        
d200 1
a200 2
  
  
d217 1
a217 1
        
d223 1
a223 2
  
  
d240 1
a240 1
        
d246 1
a246 2
  
  
d263 1
a263 1
        
d269 1
a269 2
  
  
d286 1
a286 1
        
d292 1
a292 2
  
  
a301 110
 
   
             
   
   
    /**
     * Declares an association between this object and a Project object
     *
     * @@param Project v
     */
    private Project aProject;
    public void setProject(Project v) throws Exception
    {
        aProject = null;
           setProjectId(v.getProjectId());
           aProject = v;
    }

                     
    public Project getProject() throws Exception
    {
        if ( aProject==null && (this.project_id>0) )
        {
            aProject = ProjectPeer.retrieveByPK(this.project_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.  
            // Project obj = ProjectPeer.retrieveByPK(this.project_id);
            // obj.addProjectDownloads(this);
        }
        return aProject;
    }

 
   
                 
      
   
    /**
     * Declares an association between this object and a User object
     *
     * @@param User v
     */
    private User aUserRelatedBySuggestedBy;
    public void setUserRelatedBySuggestedBy(User v) throws Exception
    {
        aUserRelatedBySuggestedBy = null;
           setSuggestedBy(v.getUserId());
           aUserRelatedBySuggestedBy = v;
    }

                     
    public User getUserRelatedBySuggestedBy() throws Exception
    {
        if ( aUserRelatedBySuggestedBy==null && (this.suggested_by>0) )
        {
            aUserRelatedBySuggestedBy = UserPeer.retrieveByPK(this.suggested_by);
            // 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.  
            // User obj = UserPeer.retrieveByPK(this.suggested_by);
            // obj.addProjectDownloadsRelatedBySuggestedBy(this);
        }
        return aUserRelatedBySuggestedBy;
    }

 
   
                 
      
   
    /**
     * Declares an association between this object and a User object
     *
     * @@param User v
     */
    private User aUserRelatedByApprovedBy;
    public void setUserRelatedByApprovedBy(User v) throws Exception
    {
        aUserRelatedByApprovedBy = null;
           setApprovedBy(v.getUserId());
           aUserRelatedByApprovedBy = v;
    }

                     
    public User getUserRelatedByApprovedBy() throws Exception
    {
        if ( aUserRelatedByApprovedBy==null && (this.approved_by>0) )
        {
            aUserRelatedByApprovedBy = UserPeer.retrieveByPK(this.approved_by);
            // 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.  
            // User obj = UserPeer.retrieveByPK(this.approved_by);
            // obj.addProjectDownloadsRelatedByApprovedBy(this);
        }
        return aUserRelatedByApprovedBy;
    }

    
        
a302 2
    private static Vector fieldNames_ = null;

d304 1
a304 1
     * Generate a list of field names.
d306 2
a307 1
    public static Vector getFieldNames()
d387 2
a388 2
         DBConnection dbCon = null;
        try
d390 9
a398 4
            dbCon = BasePeer.beginTransaction(
                ProjectDownloadPeer.getMapBuilder()
                .getDatabaseMap().getName());
            save(dbCon);
d400 1
a400 7
        catch(Exception e)
        {
            BasePeer.rollBackTransaction(dbCon);
            throw e;
        }
        BasePeer.commitTransaction(dbCon);

a402 3
      // flag to prevent endless save loop, if this object is referenced
    // by another object which falls in this transaction.
    private boolean alreadyInSave = false;
a411 3
        if (!alreadyInSave)
      {
        alreadyInSave = true;
d425 2
a426 3
              alreadyInSave = false;
      }
      }
a427 1
                                                        
a472 2
      * It then fills all the association collections and sets the
     * related objects to isNew=true.
@


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]
d34 2
a35 2
    /** the value for the proposed_by field */
    private int proposed_by;
d152 1
a152 1
     * Get the ProposedBy
d155 1
a155 1
     public int getProposedBy()
d157 1
a157 1
          return proposed_by;
d162 1
a162 1
     * Set the value of ProposedBy
d164 1
a164 1
     public void setProposedBy(int v ) throws Exception
d166 1
a166 1
                  if ( aUserRelatedByProposedBy != null && !aUserRelatedByProposedBy.isNew())
d174 1
a174 1
           if (this.proposed_by != v)
d176 1
a176 1
              this.proposed_by = v;
d377 2
a378 2
    private User aUserRelatedByProposedBy;
    public void setUserRelatedByProposedBy(User v) throws Exception
d380 3
a382 3
        aUserRelatedByProposedBy = null;
           setProposedBy(v.getUserId());
           aUserRelatedByProposedBy = v;
d386 1
a386 1
    public User getUserRelatedByProposedBy() throws Exception
d388 1
a388 1
        if ( aUserRelatedByProposedBy==null && (this.proposed_by>0) )
d390 1
a390 1
            aUserRelatedByProposedBy = UserPeer.retrieveByPK(this.proposed_by);
d397 2
a398 2
            // User obj = UserPeer.retrieveByPK(this.proposed_by);
            // obj.addProjectDownloadsRelatedByProposedBy(this);
d400 1
a400 1
        return aUserRelatedByProposedBy;
d456 1
a456 1
            fieldNames_.add("ProposedBy");
d489 1
a489 1
            if (name.equals("ProposedBy"))
d491 1
a491 1
	  	    return new Integer(getProposedBy());
d632 1
a632 1
         copyObj.setProposedBy(proposed_by);
@


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
@@


