| java.lang.Object com.ivata.mask.web.demo.catalog.Catalog
Catalog | final public class Catalog implements PersistenceManager(Code) | |
This is the main class of the demo. It represents a catalog of products.
author: Colin MacLeod author: colin.macleod@ivata.com since: ivata masks 0.1 (2004-05-09) version: $Revision: 1.17 $ |
Field Summary | |
final public static int | INVALID_ID Unique id for invalid objects. |
Method Summary | |
public synchronized ValueObject | add(PersistenceSession session, ValueObject valueObject)
Add a new object to be persisted.
Parameters: session - open persistence session, used to store the object. Parameters: valueObject - value object to be persisted. | public synchronized void | amend(PersistenceSession session, ValueObject valueObject)
Persist changes to an existing object. | public List | findAll(PersistenceSession session, Class classParam) Retrieve all instances of a particular class. | public ValueObject | findByPrimaryKey(PersistenceSession session, Class classParam, Serializable key) Retrieve a single instance of a particular class. | public static synchronized Catalog | getInstance()
Get the sole instance of this class.
For the demo, this is a singleton. | public synchronized MaskFactory | getMaskFactory()
Get the mask factory used throughout this application. | public PersistenceSession | openSession()
Open a catalog session. | public PersistenceSession | openSession(HttpSession webSessionParam)
Open a catalog session. | public PersistenceSession | openSession(Object systemSession) You can't use a system session in this simple demo. | public void | remove(PersistenceSession session, Class classParam, Serializable key)
Remove a value object from the system.
Parameters: session - open persistence session, used to remove the object. Parameters: classParam - class of object to be retrieved. | public void | reset()
Reset the catalog to its initial state. | public void | setMaskFactory(MaskFactory factory)
Set the mask factory used throughout this application. | protected void | setPropertyValues(ValueObject from, ValueObject to)
Override to set all property values from one value object to another. |
INVALID_ID | final public static int INVALID_ID(Code) | | Unique id for invalid objects.
|
findAll | public List findAll(PersistenceSession session, Class classParam)(Code) | | Retrieve all instances of a particular class. This method is used in
the list pages.
Parameters: session - open persistence session, used to fetch the objects. Parameters: classParam - class of objects to be retrieved. Must be a subclassof ValueObject . List containing instances of the requested class. See Also: com.ivata.mask.PersistenceManager.locateByBaseClass |
getInstance | public static synchronized Catalog getInstance()(Code) | |
Get the sole instance of this class.
For the demo, this is a singleton. It's better to use dependency
injection or service locator patterns, in real life.
only instance of this class. |
getMaskFactory | public synchronized MaskFactory getMaskFactory()(Code) | |
Get the mask factory used throughout this application. This is used to
create and retrieve input/list masks.
mask factory used throughout this application. |
reset | public void reset()(Code) | |
Reset the catalog to its initial state.
|
setMaskFactory | public void setMaskFactory(MaskFactory factory)(Code) | |
Set the mask factory used throughout this application.
Parameters: factory - mask factory used throughout this application. |
setPropertyValues | protected void setPropertyValues(ValueObject from, ValueObject to)(Code) | |
Override to set all property values from one value object to another.
Parameters: from - value object to take values from. Parameters: to - value object to set values in. |
|
|