org.apache.lokahi.core.api.environment
Class Environment

java.lang.Object
  extended by org.apache.lokahi.core.common.interfaces.RestObject
      extended by org.apache.lokahi.core.common.interfaces.TMCDao<Environment>
          extended by org.apache.lokahi.core.api.environment.Environment
All Implemented Interfaces:
Collectable, Dao<Environment>, Restable

public class Environment
extends TMCDao<Environment>

Version:
$Id: Environment.java,v 1.4 2006/03/13 21:56:56 drtobes Exp $
Author:
Stephen Toback

Constructor Summary
Environment()
           
Environment(int id, java.lang.String name, java.lang.String comment)
           
Environment(java.lang.String name)
           
Environment(java.lang.String name, java.lang.String comment)
           
 
Method Summary
 java.lang.StringBuilder buildShortXMLRepresentation()
          Builds a short xml representation of this object containing name, and primary key.
 java.lang.StringBuilder buildXMLRepresention()
          Builds a xml representation of this object
 boolean equals(java.lang.Object o)
           
 Environment fillObject(java.sql.ResultSet r)
          Creates the Dao from the passed resultset, internally calling the appriate constructor.
 Environment get(int id)
           
 java.lang.String getComment()
           
static Environment getEnviroment(int id, boolean fromCache)
          Deprecated.  
static java.util.Collection<Environment> getEnviroments()
           
static java.util.Collection<Environment> getEnviroments(Project p)
           
 java.lang.String getName()
          Gets the name.
 int getPk()
          Gets the primary key
 int hashCode()
           
 void setComment(java.lang.String comment)
           
 void setName(java.lang.String name)
           
 void setPk(int id)
           
 java.lang.String toString()
           
 
Methods inherited from class org.apache.lokahi.core.common.interfaces.RestObject
elementBuilder, elementBuilder
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Environment

public Environment()

Environment

public Environment(java.lang.String name)

Environment

public Environment(java.lang.String name,
                   java.lang.String comment)

Environment

public Environment(int id,
                   java.lang.String name,
                   java.lang.String comment)
Method Detail

getPk

public int getPk()
Description copied from interface: Collectable
Gets the primary key

Returns:
the int primary key

setPk

public void setPk(int id)

getName

public java.lang.String getName()
Description copied from interface: Collectable
Gets the name.

Returns:
the String name.

setName

public void setName(java.lang.String name)

getComment

public java.lang.String getComment()

setComment

public void setComment(java.lang.String comment)

get

public Environment get(int id)
                throws java.sql.SQLException
Specified by:
get in class TMCDao<Environment>
Throws:
java.sql.SQLException

getEnviroment

public static Environment getEnviroment(int id,
                                        boolean fromCache)
                                 throws java.sql.SQLException
Deprecated. 

Parameters:
id -
fromCache -
Returns:
Throws:
java.sql.SQLException

getEnviroments

public static java.util.Collection<Environment> getEnviroments()
                                                        throws java.sql.SQLException
Throws:
java.sql.SQLException

getEnviroments

public static java.util.Collection<Environment> getEnviroments(Project p)
                                                        throws java.sql.SQLException
Throws:
java.sql.SQLException

fillObject

public Environment fillObject(java.sql.ResultSet r)
                       throws java.sql.SQLException
Description copied from interface: Dao
Creates the Dao from the passed resultset, internally calling the appriate constructor.

Parameters:
r - the resultset from a database call, should include the entire object
Returns:
Object populated from the resultset
Throws:
java.sql.SQLException

buildShortXMLRepresentation

public java.lang.StringBuilder buildShortXMLRepresentation()
Description copied from interface: Restable
Builds a short xml representation of this object containing name, and primary key.

Returns:
the xml representation

buildXMLRepresention

public java.lang.StringBuilder buildXMLRepresention()
Description copied from interface: Restable
Builds a xml representation of this object

Returns:
the xml representation

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object