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.57;	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.38;	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 BaseAuditLogEntry.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 314
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 AuditLogEntry 
 */
abstract class BaseAuditLogEntry extends BaseObject
{
    /** the value for the entry_id field */
    private int entry_id;
    /** the value for the timestamp field */
    private Date timestamp;
    /** the value for the affected_type field */
    private String affected_type;
    /** the value for the affected_id field */
    private int affected_id;
    /** the value for the initiating_user field */
    private int initiating_user;
    /** the value for the description field */
    private String description;
    /** the value for the rationale field */
    private String rationale;


    /**
     * Get the EntryId
     * @@return int
     */
     public int getEntryId()
     {
          return entry_id;
     }


    /**
     * Set the value of EntryId
     */
     public void setEntryId(int v ) 
     {


           if (this.entry_id != v)
           {
              this.entry_id = v;
              setModified(true);
          }
     }
    /**
     * Get the Timestamp
     * @@return Date
     */
     public Date getTimestamp()
     {
          return timestamp;
     }


    /**
     * Set the value of Timestamp
     */
     public void setTimestamp(Date v ) 
     {


           if ( !ObjectUtils.equals(this.timestamp, v) )
           {
              this.timestamp = v;
              setModified(true);
          }
     }
    /**
     * Get the AffectedType
     * @@return String
     */
     public String getAffectedType()
     {
          return affected_type;
     }


    /**
     * Set the value of AffectedType
     */
     public void setAffectedType(String v ) 
     {


           if ( !ObjectUtils.equals(this.affected_type, v) )
           {
              this.affected_type = v;
              setModified(true);
          }
     }
    /**
     * Get the AffectedId
     * @@return int
     */
     public int getAffectedId()
     {
          return affected_id;
     }


    /**
     * Set the value of AffectedId
     */
     public void setAffectedId(int v ) 
     {


           if (this.affected_id != v)
           {
              this.affected_id = v;
              setModified(true);
          }
     }
    /**
     * Get the InitiatingUser
     * @@return int
     */
     public int getInitiatingUser()
     {
          return initiating_user;
     }


    /**
     * Set the value of InitiatingUser
     */
     public void setInitiatingUser(int v ) 
     {


           if (this.initiating_user != v)
           {
              this.initiating_user = 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 Rationale
     * @@return String
     */
     public String getRationale()
     {
          return rationale;
     }


    /**
     * Set the value of Rationale
     */
     public void setRationale(String v ) 
     {


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

       }


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

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


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

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

    /**
     * Makes a copy of this object.  
     * It creates a new object filling in the simple attributes.
      */
    public AuditLogEntry copy() throws Exception
    {
        AuditLogEntry copyObj = new AuditLogEntry();
         copyObj.setEntryId(entry_id);
         copyObj.setTimestamp(timestamp);
         copyObj.setAffectedType(affected_type);
         copyObj.setAffectedId(affected_id);
         copyObj.setInitiatingUser(initiating_user);
         copyObj.setDescription(description);
         copyObj.setRationale(rationale);
 
  
                        
        copyObj.setEntryId(NEW_ID);
                                                     return copyObj;
    }             

}
@


1.1.2.2
log
@Changes to generated classes.
@
text
@d20 1
a20 1
public abstract class BaseAuditLogEntry 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
a201 56
    /**
     * Generate a Vector with field names.
     */
    static private Vector fieldNames_ = null;
    static public Vector getFieldNames()
    {
      if (fieldNames_ == null)
      {
        fieldNames_ = new Vector();
            fieldNames_.add("EntryId");
            fieldNames_.add("Timestamp");
            fieldNames_.add("AffectedType");
            fieldNames_.add("AffectedId");
            fieldNames_.add("InitiatingUser");
            fieldNames_.add("Description");
            fieldNames_.add("Rationale");
          }
      return fieldNames_;
    }

    /**
     * Retrieves a field from the object by name passed in
     * as a String.
     */
    public Object getByName(String name)
    {
            if (name.equals("EntryId"))
	{
	  	    return new Integer(getEntryId());
	  	}
            if (name.equals("Timestamp"))
	{
	  	    return getTimestamp();
	  	}
            if (name.equals("AffectedType"))
	{
	  	    return getAffectedType();
	  	}
            if (name.equals("AffectedId"))
	{
	  	    return new Integer(getAffectedId());
	  	}
            if (name.equals("InitiatingUser"))
	{
	  	    return new Integer(getInitiatingUser());
	  	}
            if (name.equals("Description"))
	{
	  	    return getDescription();
	  	}
            if (name.equals("Rationale"))
	{
	  	    return getRationale();
	  	}
            return null; 
    }
d309 1
a309 1
                       
d313 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
d48 1
a48 1
        
d54 1
a54 2
  
  
d71 1
a71 1
        
d77 1
a77 2
  
  
d94 1
a94 1
        
d100 1
a100 2
  
  
d117 1
a117 1
        
d123 1
a123 2
  
  
d140 1
a140 1
            
d144 1
a144 1
     public void setInitiatingUser(int v ) throws Exception
d146 1
a146 7
                  if ( aUser != null && !aUser.isNew())
        {
            throw new Exception("Can't set a foreign key directly after an "
                + " association is already made based on saved data.");
        }
  
  
d163 1
a163 1
        
d169 1
a169 2
  
  
d186 1
a186 1
        
d192 1
a192 2
  
  
a201 36
 
   
             
   
   
    /**
     * Declares an association between this object and a User object
     *
     * @@param User v
     */
    private User aUser;
    public void setUser(User v) throws Exception
    {
        aUser = null;
           setInitiatingUser(v.getUserId());
           aUser = v;
    }

                     
    public User getUser() throws Exception
    {
        if ( aUser==null && (this.initiating_user>0) )
        {
            aUser = UserPeer.retrieveByPK(this.initiating_user);
            // 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.initiating_user);
            // obj.addAuditLogEntrys(this);
        }
        return aUser;
    }

a202 4
        
    
    private static Vector fieldNames_ = null;

d204 1
a204 1
     * Generate a list of field names.
d206 2
a207 1
    public static Vector getFieldNames()
d267 2
a268 2
         DBConnection dbCon = null;
        try
d270 9
a278 4
            dbCon = BasePeer.beginTransaction(
                AuditLogEntryPeer.getMapBuilder()
                .getDatabaseMap().getName());
            save(dbCon);
d280 1
a280 7
        catch(Exception e)
        {
            BasePeer.rollBackTransaction(dbCon);
            throw e;
        }
        BasePeer.commitTransaction(dbCon);

a282 3
      // flag to prevent endless save loop, if this object is referenced
    // by another object which falls in this transaction.
    private boolean alreadyInSave = false;
a291 3
        if (!alreadyInSave)
      {
        alreadyInSave = true;
d305 2
a306 3
              alreadyInSave = false;
      }
      }
a307 1
                                        
a352 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]
@


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


