com.xmlserv.app.phonebook
Class PhoneBook.Entry

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

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

Inner class for hanlding phonebook entries. To keep the implementation simple, this is oneway-only: Either an entry is loaded from the DB or a new instance is created and saved to the DB.


Constructor Summary
PhoneBook.Entry(java.sql.Connection con, int id)
          Load by ID.
PhoneBook.Entry(java.sql.Connection con, int userid, int id)
          Load entry identified by ID.
PhoneBook.Entry(java.sql.Connection con, int userid, java.lang.String anrede, java.lang.String nachname, java.lang.String vorname, java.lang.String firma, java.lang.String email, java.lang.String telephon, java.lang.String fax, java.lang.String isdn, java.lang.String strasse, java.lang.String plz, java.lang.String ort, java.lang.String land)
          Create new Entry, saving to DB.
PhoneBook.Entry(int userid)
          Create empty entry.
PhoneBook.Entry(int userid, java.lang.String anrede, java.lang.String nachname, java.lang.String vorname, java.lang.String firma, java.lang.String email, java.lang.String telephon, java.lang.String fax, java.lang.String isdn, java.lang.String strasse, java.lang.String plz, java.lang.String ort, java.lang.String land)
          Create new entry without saving date to DB.
 
Method Summary
 void delete(java.sql.Connection con)
           
 java.lang.String getAnrede()
           
 int getCategory()
           
 java.lang.String getEmail()
           
 java.lang.String getFax()
           
 java.lang.String getFirma()
           
 int getId()
           
 java.lang.String getIsdn()
           
 java.lang.String getLand()
           
 java.lang.String getNachname()
           
 java.lang.String getName()
           
 java.lang.String getOrt()
           
 java.lang.String getPlz()
           
 java.lang.String getStrasse()
           
 java.lang.String getTelephon()
           
 int getUserid()
           
 boolean isIspublic()
           
 void load(java.sql.Connection con)
          Load data from DB. id must be set before calling this method.
 void save(java.sql.Connection con)
          Save data to DB.
 void setAnrede(java.lang.String anrede)
           
 void setCategory(int category)
           
 void setEmail(java.lang.String email)
           
 void setFax(java.lang.String fax)
           
 void setFirma(java.lang.String firma)
           
 void setIsdn(java.lang.String isdn)
           
 void setIspublic(boolean ispublic)
           
 void setLand(java.lang.String land)
           
 void setNachname(java.lang.String nachname)
           
 void setOrt(java.lang.String ort)
           
 void setPlz(java.lang.String plz)
           
 void setStrasse(java.lang.String strasse)
           
 void setTelephon(java.lang.String telephon)
           
 void setVorname(java.lang.String vorname)
           
 org.jdom.Element toElement(java.sql.Connection con)
           
 void use(java.sql.Connection con)
          Update lastuse and usecount fields.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PhoneBook.Entry

public PhoneBook.Entry(int userid)
Create empty entry.

PhoneBook.Entry

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

PhoneBook.Entry

public PhoneBook.Entry(java.sql.Connection con,
                       int userid,
                       int id)
                throws XMLServException
Load entry identified by ID.

PhoneBook.Entry

public PhoneBook.Entry(int userid,
                       java.lang.String anrede,
                       java.lang.String nachname,
                       java.lang.String vorname,
                       java.lang.String firma,
                       java.lang.String email,
                       java.lang.String telephon,
                       java.lang.String fax,
                       java.lang.String isdn,
                       java.lang.String strasse,
                       java.lang.String plz,
                       java.lang.String ort,
                       java.lang.String land)
                throws XMLServException
Create new entry without saving date to DB.

PhoneBook.Entry

public PhoneBook.Entry(java.sql.Connection con,
                       int userid,
                       java.lang.String anrede,
                       java.lang.String nachname,
                       java.lang.String vorname,
                       java.lang.String firma,
                       java.lang.String email,
                       java.lang.String telephon,
                       java.lang.String fax,
                       java.lang.String isdn,
                       java.lang.String strasse,
                       java.lang.String plz,
                       java.lang.String ort,
                       java.lang.String land)
                throws XMLServException
Create new Entry, saving to DB.
Method Detail

use

public void use(java.sql.Connection con)
         throws XMLServException
Update lastuse and usecount fields. Can only be called on an Entry loaded from the DB.

toElement

public org.jdom.Element toElement(java.sql.Connection con)
                           throws XMLServException

load

public void load(java.sql.Connection con)
          throws XMLServException
Load data from DB. id must be set before calling this method.

save

public void save(java.sql.Connection con)
          throws XMLServException
Save data to DB.

delete

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

getId

public int getId()

getUserid

public int getUserid()

getCategory

public int getCategory()

setCategory

public void setCategory(int category)

getAnrede

public java.lang.String getAnrede()

setAnrede

public void setAnrede(java.lang.String anrede)

getName

public java.lang.String getName()

getNachname

public java.lang.String getNachname()

setNachname

public void setNachname(java.lang.String nachname)

setVorname

public void setVorname(java.lang.String vorname)

getFirma

public java.lang.String getFirma()

setFirma

public void setFirma(java.lang.String firma)

getEmail

public java.lang.String getEmail()

setEmail

public void setEmail(java.lang.String email)

getTelephon

public java.lang.String getTelephon()

setTelephon

public void setTelephon(java.lang.String telephon)

getFax

public java.lang.String getFax()

setFax

public void setFax(java.lang.String fax)

getIsdn

public java.lang.String getIsdn()

setIsdn

public void setIsdn(java.lang.String isdn)

getStrasse

public java.lang.String getStrasse()

setStrasse

public void setStrasse(java.lang.String strasse)

getPlz

public java.lang.String getPlz()

setPlz

public void setPlz(java.lang.String plz)

getOrt

public java.lang.String getOrt()

setOrt

public void setOrt(java.lang.String ort)

getLand

public java.lang.String getLand()

setLand

public void setLand(java.lang.String land)

isIspublic

public boolean isIspublic()

setIspublic

public void setIspublic(boolean ispublic)