|
Rakesh API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbiz.wedoit4u.databeans.SitePropertyBean
public class SitePropertyBean
A Java Bean that represents a record in the site_properties
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 customer_id.
Copyright 2003, Rakesh Vidyadharan
| Field Summary | |
|---|---|
static int |
BOTTOM_RAIL
The default value to be used for the bottom_rail flag. |
int |
bottomRail
The value in the bottom_rail 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. |
private int |
customerId
The value in the customer_id column. |
java.lang.String |
footer
The value in the footer column. |
static java.lang.String |
FOOTER
The default value to be used for the footer column. |
java.lang.String |
header
The value in the header column. |
static java.lang.String |
HEADER
The default value to be used for the header column. |
static int |
LEFT_RAIL
The default value to be used for the left_rail flag. |
int |
leftRail
The value in the left_rail column. |
private static java.lang.Object |
lockObject
An object that is used to synchronise modifications
to the system cache of instances of these beans. |
static int |
RIGHT_RAIL
The default value to be used for the right_rail flag. |
int |
rightRail
The value in the right_rail column. |
static int |
TOP_RAIL
The default value to be used for the top_rail flag. |
int |
topRail
The value in the top_rail column. |
| Constructor Summary | |
|---|---|
private |
SitePropertyBean()
The default constructor. |
| Method Summary | |
|---|---|
static SitePropertyBean |
create(int customerId)
Create a new instance of the bean for the specified
customer_id with default values. |
static SitePropertyBean |
create(int customerId,
int topRail,
int leftRail,
int rightRail,
int bottomRail,
java.lang.String header,
java.lang.String footer)
Create a new instance of the bean that may be used to create a corresponding record in the site_properties table. |
static void |
delete(SitePropertyBean spb)
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 site_properties table. |
int |
getCustomerId()
Returns customerId. |
static SitePropertyBean |
getInstance(int customerId)
Fetch the instance of the bean identified by the primary
key value specified. |
void |
save()
Write back all the values in the bean fields to the database. |
static void |
setInstance(SitePropertyBean 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
public static final int TOP_RAIL
top_rail flag.
Default to off (0).
public static final int LEFT_RAIL
left_rail flag.
Default to off (0).
public static final int RIGHT_RAIL
right_rail flag.
Default to off (0).
public static final int BOTTOM_RAIL
bottom_rail flag.
Default to off (0).
public static final java.lang.String HEADER
header column.
Default to an empty string.
public static final java.lang.String FOOTER
footer column.
Default to an empty string.
private int customerId
customer_id column.
public int topRail
top_rail column.
public int leftRail
left_rail column.
public int rightRail
right_rail column.
public int bottomRail
bottom_rail column.
public java.lang.String header
header column.
public java.lang.String footer
footer column.
| Constructor Detail |
|---|
private SitePropertyBean()
| Method Detail |
|---|
public static final SitePropertyBean create(int customerId)
throws CMAException
customer_id with default values.
Note: The primary key column for this table also has a
foreign key relation ship with the customers.customer_id
column.
customerId - - The primary key value to use.
CMAException - - If an attempt is made to create an instance
of the object that already exists, as identified by the
customerId value.
public static final SitePropertyBean create(int customerId,
int topRail,
int leftRail,
int rightRail,
int bottomRail,
java.lang.String header,
java.lang.String footer)
throws CMAException
site_properties table.
Note: The primary key column for this table also has a
foreign key relation ship with the customers.customer_id
column.
customerId - - The primary key value to use.topRail - - The top_rail value. This should
be 0 or 1.leftRail - - The left_rail value. This
should be 0 or 1.rightRail - - The right_rail value. This
should be 0 or 1.bottomRail - - The bottom_rail value. This
should be 0 or 1.header - - The header column value.footer - - A footer column value.
CMAException - - If an attempt is made to create an instance
of the object that already exists, as identified by the
customerId value.
public static final void delete(SitePropertyBean spb)
throws CMAException
spb - - The bean instance that is to be
removed.
CMAException - - If errors are encountered while removing
the associated record in the database.SitePropertyHelper.delete( int )
public void save()
throws CMAException
site_properties 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 java.util.Collection findAll()
throws CMAException
Collection of bean instances that represent
all the records in the site_properties table.
CMAException - - If errors are encountered while fetching
all the bean instances.
public static final SitePropertyBean getInstance(int customerId)
throws CMAException
primary
key value specified. If the bean instance does not exist
in the cache, try to fetch it from the database.
customerId - - The customer_id
value based upon which to fetch the instance.
CMAException - - If the specified bean instance is not
available in the system cache.public static final void setInstance(SitePropertyBean 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 getCustomerId()
customerId.
|
Rakesh API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||