|
Rakesh API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbiz.wedoit4u.databeans.StyleClassBean
public class StyleClassBean
A Java Bean that represents a record in the style_classes
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 style_class_id.
Copyright 2003, Rakesh Vidyadharan
| Field Summary | |
|---|---|
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.lang.String |
className
The value in the class_name column. |
java.lang.String |
description
The value in the description column. |
private static java.lang.Object |
lockObject
An object that is used to synchronise modifications
to the system cache of instances of these beans. |
private int |
styleClassId
The value in the style_class_id column. |
| Constructor Summary | |
|---|---|
private |
StyleClassBean()
The default constructor. |
| Method Summary | |
|---|---|
static StyleClassBean |
create(int styleClassId,
java.lang.String className,
java.lang.String description)
Create a new instance of the bean that may be used to create a corresponding record in the style_classes table. |
static void |
delete(StyleClassBean cb)
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 style_classes table. |
static StyleClassBean |
getInstance(int styleClassId)
Fetch the instance of the bean identified by the primary
key value specified. |
int |
getStyleClassId()
Returns styleClassId. |
void |
save()
Write back all the values in the bean fields to the database. |
static void |
setInstance(StyleClassBean scb)
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 styleClassId
style_class_id column.
public java.lang.String className
class_name column.
public java.lang.String description
description column.
| Constructor Detail |
|---|
private StyleClassBean()
| Method Detail |
|---|
public static final StyleClassBean create(int styleClassId,
java.lang.String className,
java.lang.String description)
throws CMAException
style_classes table.
If you wish the database sequence value be used to populate
the style_class_id value, then specify a value
of 0 for styleClassId. All new instances
created are added to the system cache, unless they are created
with a customerId value of 0.
styleClassId - - The primary key value to use.className - - The name of CSS class.description - - A detailed description about the
purpose of the CSS class.
CMAException - - If an attempt is made to create an instance
of the object that already exists, as identified by the
styleClassId value.
public static final void delete(StyleClassBean cb)
throws CMAException
cb - - The bean instance that is to be
removed.
CMAException - - If errors are encountered while removing
the associated record in the database.StyleClassHelper.delete( int )
public void save()
throws CMAException
style_classes 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 style_classes table.
CMAException - - If errors are encountered while fetching
all the bean instances.
public static final StyleClassBean getInstance(int styleClassId)
throws CMAException
primary
key value specified. If the bean instance does not exist
in the cache, try to fetch it from the database.
styleClassId - - The style_class_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(StyleClassBean scb)
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.
scb - - The instance that is being added to
the system cache.public final int getStyleClassId()
styleClassId.
|
Rakesh API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||