All Packages Class Hierarchy This Package Previous Next Index
Class com.sdi.wap.demo.bean.AccountBean
java.lang.Object
|
+----com.sdi.wap.demo.bean.BeanImpl
|
+----com.sdi.wap.demo.bean.AccountBean
- public class AccountBean
- extends BeanImpl
- implements Account, Serializable
-
accountID
- Instance information (stored in DBMS)
-
address
-
-
connection
- Cached information (computed and stored with the session, not in the database)
-
email
-
-
name
-
-
whenCreated
-
-
AccountBean(Connection, Identifier, Name, Email)
- Insert the method's description here.
-
defineAccount(Name, Email)
- Create this account (in RAM AND in DBMS)
-
finalize()
- Finalize by returning this account's connection to the pool.
-
getAccountID()
- Insert the method's description here.
-
getAddress()
- Return the address information for this account.
-
getConnection()
- Returns a connection for this account, caching a new one from
the ConnectionPool if necessary.
-
getEmail()
- Insert the method's description here.
-
getName()
- Insert the method's description here.
-
getWhenCreated()
- Insert the method's description here.
-
hasRole(Role)
- Does this account play the indicated role?.
-
isValid()
- Determine validity of user-supplied information
-
load(Connection, Identifier)
-
-
returnConnection(Connection)
- Insert the method's description here.
-
save(Connection)
-
-
setAddress(AddressBean)
- Insert the method's description here.
-
setName(Name)
- Set the name field of this account.
-
setWhenCreated(Timestamp)
- Set the creation date
-
toString()
-
accountID
private Identifier accountID
- Instance information (stored in DBMS)
name
private Name name
email
private Email email
whenCreated
private Timestamp whenCreated
connection
private transient Connection connection
- Cached information (computed and stored with the session, not in the database)
address
private AddressBean address
AccountBean
private AccountBean(Connection connection,
Identifier accountID,
Name name,
Email email) throws Exception
- Insert the method's description here.
Creation date: (02/14/00 18:48:07)
- Parameters:
- s - java.lang.String
defineAccount
public static final AccountBean defineAccount(Name name,
Email email) throws Exception
- Create this account (in RAM AND in DBMS)
finalize
public void finalize()
- Finalize by returning this account's connection to the pool.
- Overrides:
- finalize in class Object
getAccountID
public Identifier getAccountID()
- Insert the method's description here.
- Returns:
- java.lang.String
getAddress
public AddressBean getAddress() throws Exception
- Return the address information for this account. (cached)
Creation date: (04/30/00 13:13:36)
getConnection
public Connection getConnection() throws Exception
- Returns a connection for this account, caching a new one from
the ConnectionPool if necessary. The Connection will be returned
to the pool by the finalize method.
This is an possibly dangerous experiment trying to simplify connection
pool management by JSP programs. Without this (or something) similar
every JSP program will need to get a connection from the pool, remember
to return it, and pass it as an argument to all methods that might
need to touch the database at some point. This was becoming impossibly
tedious, so I'm looking for a way to hide this.
Creation date: (05/03/00 17:08:37)
- Returns:
- java.sql.Connection
getEmail
public Email getEmail() throws Exception
- Insert the method's description here.
Creation date: (04/30/00 13:13:36)
getName
public Name getName()
- Insert the method's description here.
Creation date: (04/30/00 13:13:36)
getWhenCreated
public Timestamp getWhenCreated()
- Insert the method's description here.
Creation date: (05/09/00 20:17:09)
- Returns:
- long
hasRole
public boolean hasRole(Role role) throws Exception
- Does this account play the indicated role?.
isValid
public boolean isValid()
- Determine validity of user-supplied information
- Returns:
- boolean
- Overrides:
- isValid in class BeanImpl
load
public static AccountBean load(Connection connection,
Identifier accountID) throws Exception
returnConnection
public void returnConnection(Connection connection)
- Insert the method's description here.
Creation date: (05/03/00 20:19:15)
save
public Identifier save(Connection connection) throws Exception
setAddress
public void setAddress(AddressBean address)
- Insert the method's description here.
Creation date: (01/24/00 22:46:48)
- Parameters:
- newStatus - java.lang.String
setName
public void setName(Name name)
- Set the name field of this account. Changing the name
does NOT and must not affect the account identifier!
setWhenCreated
public void setWhenCreated(Timestamp newWhenCreated)
- Set the creation date
- Parameters:
- newWhenCreated - Timestamp
toString
public String toString()
- Returns:
- java.lang.String
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index