com.xmlserv.app.phonebook
Class PhoneBook.Category

java.lang.Object
  |
  +--com.xmlserv.app.phonebook.PhoneBook.Category
Enclosing class:
PhoneBook

public static class PhoneBook.Category
extends java.lang.Object

Abstraction of Phonebook categories.


Constructor Summary
PhoneBook.Category(java.sql.Connection con, int id)
          Load category by ID.
PhoneBook.Category(java.sql.Connection con, java.lang.String name)
          Load category by name.
PhoneBook.Category(int userid, java.lang.String name)
          Create new category.
 
Method Summary
 int getId()
           
 java.lang.String getName()
           
 int getUserid()
           
static org.jdom.Element list(java.sql.Connection con, int userid)
          List all categories defined for the given userid.
 void save(java.sql.Connection con)
           
 void setName(java.lang.String name)
           
 void setUserid(int userid)
           
 org.jdom.Element toElement()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PhoneBook.Category

public PhoneBook.Category(int userid,
                          java.lang.String name)
Create new category.

PhoneBook.Category

public PhoneBook.Category(java.sql.Connection con,
                          int id)
                   throws XMLServException
Load category by ID.

PhoneBook.Category

public PhoneBook.Category(java.sql.Connection con,
                          java.lang.String name)
                   throws XMLServException
Load category by name.
Method Detail

save

public void save(java.sql.Connection con)
          throws XMLServException

toElement

public org.jdom.Element toElement()

list

public static org.jdom.Element list(java.sql.Connection con,
                                    int userid)
                             throws XMLServException
List all categories defined for the given userid.

getId

public int getId()

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

getUserid

public int getUserid()

setUserid

public void setUserid(int userid)