org.apache.lokahi.core.api.instance
Class Instance

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

public class Instance
extends TMCDao<Instance>

Version:
$Id: Instance.java,v 1.2 2006/03/07 20:18:47 drtobes Exp $
Author:
Stephen Toback

Constructor Summary
Instance()
           
Instance(int id, java.lang.String name, java.lang.String comments)
           
Instance(java.lang.String name)
           
Instance(java.lang.String name, java.lang.String comments)
           
 
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)
           
 Instance fillObject(java.sql.ResultSet r)
          Creates the Dao from the passed resultset, internally calling the appriate constructor.
 Instance get(int id)
           
 java.lang.String getComments()
           
static Instance getInstance(int id, boolean fromCache)
          Deprecated.  
static Instance getInstance(java.lang.String name, boolean fromCache)
           
static java.util.Collection<Instance> getInstances()
           
 java.lang.String getName()
          Gets the name.
 int getPk()
          Gets the primary key
 int hashCode()
           
 void setComments(java.lang.String comments)
           
 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

Instance

public Instance()

Instance

public Instance(java.lang.String name)

Instance

public Instance(java.lang.String name,
                java.lang.String comments)

Instance

public Instance(int id,
                java.lang.String name,
                java.lang.String comments)
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)

getComments

public java.lang.String getComments()

setComments

public void setComments(java.lang.String comments)

get

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

getInstance

public static Instance getInstance(int id,
                                   boolean fromCache)
                            throws java.sql.SQLException
Deprecated. 

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

getInstance

public static Instance getInstance(java.lang.String name,
                                   boolean fromCache)
                            throws java.sql.SQLException
Throws:
java.sql.SQLException

getInstances

public static java.util.Collection<Instance> getInstances()
                                                   throws java.sql.SQLException
Throws:
java.sql.SQLException

fillObject

public Instance 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

toString

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

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