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 BaseSkinStyleElementValue.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 250
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 SkinStyleElementValue 
 */
abstract class BaseSkinStyleElementValue extends BaseObject
{
    /** the value for the skin_id field */
    private int skin_id;
    /** the value for the style_id field */
    private int style_id;
    /** the value for the element_id field */
    private int element_id;
    /** the value for the value field */
    private String value;


    /**
     * Get the SkinId
     * @@return int
     */
     public int getSkinId()
     {
          return skin_id;
     }


    /**
     * Set the value of SkinId
     */
     public void setSkinId(int v ) 
     {


           if (this.skin_id != v)
           {
              this.skin_id = v;
              setModified(true);
          }
     }
    /**
     * Get the StyleId
     * @@return int
     */
     public int getStyleId()
     {
          return style_id;
     }


    /**
     * Set the value of StyleId
     */
     public void setStyleId(int v ) 
     {


           if (this.style_id != v)
           {
              this.style_id = v;
              setModified(true);
          }
     }
    /**
     * Get the ElementId
     * @@return int
     */
     public int getElementId()
     {
          return element_id;
     }


    /**
     * Set the value of ElementId
     */
     public void setElementId(int v ) 
     {


           if (this.element_id != v)
           {
              this.element_id = v;
              setModified(true);
          }
     }
    /**
     * Get the Value
     * @@return String
     */
     public String getValue()
     {
          return value;
     }


    /**
     * Set the value of Value
     */
     public void setValue(String v ) 
     {


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

       }


    /** 
     * Set the Id using pk values.
     *
     * @@param int skin_id
     * @@param int style_id
     * @@param int element_id
     */
    public void setPrimaryKey(
                      int skin_id
                                      , int style_id
                                      , int element_id
                                         ) 
    {
                     setSkinId(skin_id);
                             setStyleId(style_id);
                             setElementId(element_id);
                            }

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


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

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

    /**
     * Makes a copy of this object.  
     * It creates a new object filling in the simple attributes.
      */
    public SkinStyleElementValue copy() throws Exception
    {
        SkinStyleElementValue copyObj = new SkinStyleElementValue();
         copyObj.setSkinId(skin_id);
         copyObj.setStyleId(style_id);
         copyObj.setElementId(element_id);
         copyObj.setValue(value);
 
  
                        
        copyObj.setSkinId(NEW_ID);
                              
        copyObj.setStyleId(NEW_ID);
                              
        copyObj.setElementId(NEW_ID);
                  return copyObj;
    }             

}
@


1.1.2.2
log
@Changes to generated classes.
@
text
@d20 1
a20 1
public abstract class BaseSkinStyleElementValue 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
a126 41
    /**
     * Generate a Vector with field names.
     */
    static private Vector fieldNames_ = null;
    static public Vector getFieldNames()
    {
      if (fieldNames_ == null)
      {
        fieldNames_ = new Vector();
            fieldNames_.add("SkinId");
            fieldNames_.add("StyleId");
            fieldNames_.add("ElementId");
            fieldNames_.add("Value");
          }
      return fieldNames_;
    }

    /**
     * Retrieves a field from the object by name passed in
     * as a String.
     */
    public Object getByName(String name)
    {
            if (name.equals("SkinId"))
	{
	  	    return new Integer(getSkinId());
	  	}
            if (name.equals("StyleId"))
	{
	  	    return new Integer(getStyleId());
	  	}
            if (name.equals("ElementId"))
	{
	  	    return new Integer(getElementId());
	  	}
            if (name.equals("Value"))
	{
	  	    return getValue();
	  	}
            return null; 
    }
d227 22
@


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
d42 1
a42 1
            
d46 1
a46 1
     public void setSkinId(int v ) throws Exception
d48 1
a48 7
                  if ( aSkin != null && !aSkin.isNew())
        {
            throw new Exception("Can't set a foreign key directly after an "
                + " association is already made based on saved data.");
        }
  
  
d65 1
a65 1
            
d69 1
a69 1
     public void setStyleId(int v ) throws Exception
d71 1
a71 7
                  if ( aStyle != null && !aStyle.isNew())
        {
            throw new Exception("Can't set a foreign key directly after an "
                + " association is already made based on saved data.");
        }
  
  
d88 1
a88 1
            
d92 1
a92 1
     public void setElementId(int v ) throws Exception
d94 1
a94 7
                  if ( aStyleElement != null && !aStyleElement.isNew())
        {
            throw new Exception("Can't set a foreign key directly after an "
                + " association is already made based on saved data.");
        }
  
  
d111 1
a111 1
        
d117 1
a117 2
  
  
a126 110
 
   
             
   
   
    /**
     * Declares an association between this object and a Skin object
     *
     * @@param Skin v
     */
    private Skin aSkin;
    public void setSkin(Skin v) throws Exception
    {
        aSkin = null;
           setSkinId(v.getSkinId());
           aSkin = v;
    }

                     
    public Skin getSkin() throws Exception
    {
        if ( aSkin==null && (this.skin_id>0) )
        {
            aSkin = SkinPeer.retrieveByPK(this.skin_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.  
            // Skin obj = SkinPeer.retrieveByPK(this.skin_id);
            // obj.addSkinStyleElementValues(this);
        }
        return aSkin;
    }

 
   
             
   
   
    /**
     * Declares an association between this object and a Style object
     *
     * @@param Style v
     */
    private Style aStyle;
    public void setStyle(Style v) throws Exception
    {
        aStyle = null;
           setStyleId(v.getStyleId());
           aStyle = v;
    }

                     
    public Style getStyle() throws Exception
    {
        if ( aStyle==null && (this.style_id>0) )
        {
            aStyle = StylePeer.retrieveByPK(this.style_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.  
            // Style obj = StylePeer.retrieveByPK(this.style_id);
            // obj.addSkinStyleElementValues(this);
        }
        return aStyle;
    }

 
   
             
   
   
    /**
     * Declares an association between this object and a StyleElement object
     *
     * @@param StyleElement v
     */
    private StyleElement aStyleElement;
    public void setStyleElement(StyleElement v) throws Exception
    {
        aStyleElement = null;
           setElementId(v.getElementId());
           aStyleElement = v;
    }

                     
    public StyleElement getStyleElement() throws Exception
    {
        if ( aStyleElement==null && (this.element_id>0) )
        {
            aStyleElement = StyleElementPeer.retrieveByPK(this.element_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.  
            // StyleElement obj = StyleElementPeer.retrieveByPK(this.element_id);
            // obj.addSkinStyleElementValues(this);
        }
        return aStyleElement;
    }

    
        
a127 2
    private static Vector fieldNames_ = null;

d129 1
a129 1
     * Generate a list of field names.
d131 2
a132 1
    public static Vector getFieldNames()
d177 2
a178 2
         DBConnection dbCon = null;
        try
d180 9
a188 9
            dbCon = BasePeer.beginTransaction(
                SkinStyleElementValuePeer.getMapBuilder()
                .getDatabaseMap().getName());
            save(dbCon);
        }
        catch(Exception e)
        {
            BasePeer.rollBackTransaction(dbCon);
            throw e;
d190 1
a190 2
        BasePeer.commitTransaction(dbCon);

a192 3
      // flag to prevent endless save loop, if this object is referenced
    // by another object which falls in this transaction.
    private boolean alreadyInSave = false;
a201 3
        if (!alreadyInSave)
      {
        alreadyInSave = true;
d215 2
a216 3
              alreadyInSave = false;
      }
      }
a217 1
                                                                
d229 1
a229 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
@@


