|
Rakesh API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbiz.wedoit4u.databeans.PartnerBean
public class PartnerBean
A java bean that represents a record in the partners
table. This bean is used to cache the values read
from the database, and to make modifications you need to the bean
fields, and then send it back to the database for updating the
associated record. All instances of this class are cached into a
Map object that is stored in the
System.getProperties() object under a property with
name CACHE_NAME. All instances variables are public except
the primary key column partner_id.
Copyright 2004, Rakesh Vidyadharan
| Field Summary | |
|---|---|
char |
active
The value in the active column. |
private static java.util.Map |
cache
The Map that is used to cache instances
of this bean. |
static java.lang.String |
CACHE_NAME
A constant that denotes the name of the system property at which all instances of this class are cached. |
java.util.Date |
creationDate
The value in the creation_date column. |
java.lang.String |
description
The value in the description column. |
java.lang.String |
email
The value in the email column. |
java.util.Date |
expirationDate
The value in the expiration_date column. |
private static java.lang.Object |
lockObject
An object that is used to synchronise modifications
to the system cache of instances of these beans. |
java.lang.String |
mobilePhone
The value in the mobile_phone column. |
private int |
partnerId
The value in the partner_id column. |
java.lang.String |
partnerName
The value in the partner_name column. |
java.lang.String |
password
The value in the password column. |
java.lang.String |
telephone
The value in the telephone column. |
java.lang.String |
username
The value in the username column. |
| Constructor Summary | |
|---|---|
private |
PartnerBean()
Default constructor. |
| Method Summary | |
|---|---|
static PartnerBean |
create(int partnerId,
java.lang.String username,
java.lang.String password,
char active,
java.util.Date expirationDate,
java.lang.String partnerName,
java.lang.String description,
java.lang.String email,
java.lang.String telephone,
java.lang.String mobilePhone)
Create a new partners record with the values
specified for all the columns in the table. |
static void |
delete(PartnerBean pb)
Delete the specified instance of this class from the system cache as well as from the database. |
static java.util.Collection |
findAll()
Return a Collection of bean instances that represent
all the records in the partners table. |
static PartnerBean |
getInstance(int partnerId)
Fetch the instance of the bean from the system cache indentified by the primary key column partnerId. |
static PartnerBean |
getInstance(java.lang.String username,
java.lang.String password)
Return the bean instance identified by the username
and password values specified. |
int |
getPartnerId()
Returns partnerId. |
void |
save()
Write back all the values in the bean fields to the database. |
static void |
setInstance(PartnerBean ctb)
Add the specified bean instance to the system cache. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final java.lang.Object lockObject
synchronise modifications
to the system cache of instances of these beans.
private static final java.util.Map cache
Map that is used to cache instances
of this bean.
public static final java.lang.String CACHE_NAME
private int partnerId
partner_id column.
public java.lang.String username
username column.
public java.lang.String password
password column.
public char active
active column.
public java.util.Date creationDate
creation_date column.
public java.util.Date expirationDate
expiration_date column.
public java.lang.String partnerName
partner_name column.
public java.lang.String description
description column.
public java.lang.String email
email column.
public java.lang.String telephone
telephone column.
public java.lang.String mobilePhone
mobile_phone column.
| Constructor Detail |
|---|
private PartnerBean()
| Method Detail |
|---|
public static final PartnerBean create(int partnerId,
java.lang.String username,
java.lang.String password,
char active,
java.util.Date expirationDate,
java.lang.String partnerName,
java.lang.String description,
java.lang.String email,
java.lang.String telephone,
java.lang.String mobilePhone)
throws CMAException
partners record with the values
specified for all the columns in the table. If you wish
to use the database sequence to generate the partner_id value,
specify a value of 0 for the partner_id.
Creating a new instance will also add the new instance of the
system cache, unless the partnerId value specified is
0.
partnerId - - The partner_id value.username - - The username value.password - - The password value.active - - The active value.expirationDate - - The expiration_date
value.partnerName - - The partner_name value.description - - The description value.email - - The email value.telephone - - The telephone value.mobilePhone - - The mobilePhone value.
CMAException - - If an attempt is made to create an instance
of the object that already exists, as identified by the
partnerId value.
public void save()
throws CMAException
partners table are
updated with the values in the bean fields.
CMAException - - If errors are encountered while writing
the values to the database.
public static final void delete(PartnerBean pb)
throws CMAException
pb - - The bean instance that is to be removed.
CMAException - - If errors are encountered while removing
the associated record in the database.
public static final PartnerBean getInstance(int partnerId)
throws CMAException
partnerId.
partnerId - - The primary key value based upon which
to find the appropriate bean instance.
CMAException - - If the appropriate bean instance is not
found.
public static final java.util.Collection findAll()
throws CMAException
Collection of bean instances that represent
all the records in the partners table.
CMAException - - If errors are encountered while fetching
all the bean instances.
public static final PartnerBean getInstance(java.lang.String username,
java.lang.String password)
throws CMAException
username
and password values specified.
username - - The username value.password - - The password value.
CMAException - - If errors are encountered while fetching
the bean instance.public static final void setInstance(PartnerBean ctb)
Map
interface in that, if an entry with the same key already exists,
then that entry is replaced, or a new one created. This method
uses the lockObject to synchronise
modifications to the Map cache.
ctb - - The instance that is being added to
the system cache.public final int getPartnerId()
partnerId.
|
Rakesh API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||