Class IDString
All Implemented Interfaces:
Serializable
public class IDString
implements Serializable
This is a helper class used to return the database index and the user-
friendly "name" string for a given object in the database table. It is very
useful when doing "shallow retrieves" of complex objects to populate, for
example, a drop-down list box of choices.
Field Summary |
|
|
|
textThis is the Object's name. |
Field Detail
id
int id = 0
Object ID number.
Defaults to 0 for a new object not yet in the database.
This '0' is used by persistence mecahnism to know whether an object
is new, and hance needs to be inserted, or if it is already in existence
(a non-zero ID), and needs to be updated.
text
String text = ""
This is the Object's name.
Constructor Detail
IDString
public IDString()
IDString
public IDString(int id)
IDString
Method Detail
clone
public Object clone()
equals
public boolean equals(Object obj)
toString
public String toString()
setID
public void setID(int value)
getID
public int getID()
setText
public void setText(String value)
getText
public String getText()