|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.ivata.mask.web.demo.catalog.Catalog
This is the main class of the demo. It represents a catalog of products.
| Field Summary | |
static int |
INVALID_ID
Unique id for invalid objects. |
| Method Summary | |
com.ivata.mask.valueobject.ValueObject |
add(com.ivata.mask.persistence.PersistenceSession session,
com.ivata.mask.valueobject.ValueObject valueObject)
Add a new object to be persisted. |
void |
amend(com.ivata.mask.persistence.PersistenceSession session,
com.ivata.mask.valueobject.ValueObject valueObject)
Persist changes to an existing object. |
java.util.List |
findAll(com.ivata.mask.persistence.PersistenceSession session,
java.lang.Class classParam)
Retrieve all instances of a particular class. |
com.ivata.mask.valueobject.ValueObject |
findByPrimaryKey(com.ivata.mask.persistence.PersistenceSession session,
java.lang.Class classParam,
java.io.Serializable key)
Retrieve a single instance of a particular class. |
static Catalog |
getInstance()
Get the sole instance of this class. |
com.ivata.mask.MaskFactory |
getMaskFactory()
Get the mask factory used throughout this application. |
com.ivata.mask.persistence.right.PersistenceRights |
getPersistenceRights()
Just returns an instance of the default rights implementation. |
com.ivata.mask.persistence.PersistenceSession |
openSession()
Open a catalog session. |
com.ivata.mask.persistence.PersistenceSession |
openSession(java.lang.Object systemSession)
You can't use a system session in this simple demo. |
void |
remove(com.ivata.mask.persistence.PersistenceSession session,
java.lang.Class classParam,
java.io.Serializable key)
Remove a value object from the system. |
void |
reset()
Reset the catalog to its initial state. |
void |
setMaskFactory(com.ivata.mask.MaskFactory factory)
Set the mask factory used throughout this application. |
protected void |
setPropertyValues(com.ivata.mask.valueobject.ValueObject from,
com.ivata.mask.valueobject.ValueObject to)
Override to set all property values from one value object to another. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int INVALID_ID
| Method Detail |
public static Catalog getInstance()
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.
public com.ivata.mask.valueobject.ValueObject add(com.ivata.mask.persistence.PersistenceSession session,
com.ivata.mask.valueobject.ValueObject valueObject)
throws com.ivata.mask.persistence.PersistenceException
Add a new object to be persisted.
add in interface com.ivata.mask.persistence.PersistenceManagersession - open persistence session, used to store the object.valueObject - value object to be persisted.
com.ivata.mask.persistence.PersistenceException - thrown by the underlying persistence
mechanism if the object cannot be saved for any reason.PersistenceManager.add(com.ivata.mask.persistence.PersistenceSession, com.ivata.mask.valueobject.ValueObject)
public void amend(com.ivata.mask.persistence.PersistenceSession session,
com.ivata.mask.valueobject.ValueObject valueObject)
throws com.ivata.mask.persistence.PersistenceException
Persist changes to an existing object.
amend in interface com.ivata.mask.persistence.PersistenceManagersession - open persistence session, used to store the changes to
the object.valueObject - value object to be persisted.
com.ivata.mask.persistence.PersistenceException - thrown by the underlying persistence
mechanism if the object cannot be saved for any reason.PersistenceManager.amend(com.ivata.mask.persistence.PersistenceSession, com.ivata.mask.valueobject.ValueObject)
public java.util.List findAll(com.ivata.mask.persistence.PersistenceSession session,
java.lang.Class classParam)
findAll in interface com.ivata.mask.persistence.PersistenceManagersession - open persistence session, used to fetch the objects.classParam - class of objects to be retrieved. Must be a subclass
of ValueObject.
List containing instances of the requested class.com.ivata.mask.PersistenceManager#locateByBaseClass
public com.ivata.mask.valueobject.ValueObject findByPrimaryKey(com.ivata.mask.persistence.PersistenceSession session,
java.lang.Class classParam,
java.io.Serializable key)
throws com.ivata.mask.persistence.PersistenceException
findByPrimaryKey in interface com.ivata.mask.persistence.PersistenceManagersession - open persistence session, used to fetch the object.classParam - class of object to be retrieved. Must be a subclass
of ValueObject.key - unique identifier of the object to retrieve.
key.
com.ivata.mask.persistence.PersistenceException - thrown by the underlying persistence
mechanism if the object cannot be retrieved for any reason.PersistenceManager.findByPrimaryKey(com.ivata.mask.persistence.PersistenceSession, java.lang.Class, java.io.Serializable)public com.ivata.mask.MaskFactory getMaskFactory()
Get the mask factory used throughout this application. This is used to create and retrieve input/list masks.
public com.ivata.mask.persistence.right.PersistenceRights getPersistenceRights()
getPersistenceRights in interface com.ivata.mask.persistence.PersistenceManagerDefaultPersistenceRights.
public com.ivata.mask.persistence.PersistenceSession openSession()
throws com.ivata.mask.persistence.PersistenceException
Open a catalog session.
openSession in interface com.ivata.mask.persistence.PersistenceManagercom.ivata.mask.persistence.PersistenceExceptionPersistenceManager.openSession()
public com.ivata.mask.persistence.PersistenceSession openSession(java.lang.Object systemSession)
throws com.ivata.mask.persistence.PersistenceException
UnsupportedOperationException.
openSession in interface com.ivata.mask.persistence.PersistenceManagersystemSession -
com.ivata.mask.persistence.PersistenceExceptionPersistenceManager.openSession()
public void remove(com.ivata.mask.persistence.PersistenceSession session,
java.lang.Class classParam,
java.io.Serializable key)
throws com.ivata.mask.persistence.PersistenceException
Remove a value object from the system.
remove in interface com.ivata.mask.persistence.PersistenceManagersession - open persistence session, used to remove the object.classParam - class of object to be retrieved. Must be a subclass
of ValueObject.key - unique identifier of the object to retrieve.
com.ivata.mask.persistence.PersistenceException - thrown by the underlying persistence
mechanism if the object cannot be removed for any reason.PersistenceManager.remove(com.ivata.mask.persistence.PersistenceSession, java.lang.Class, java.io.Serializable)public void reset()
Reset the catalog to its initial state.
public void setMaskFactory(com.ivata.mask.MaskFactory factory)
Set the mask factory used throughout this application.
factory - mask factory used throughout this application.
protected void setPropertyValues(com.ivata.mask.valueobject.ValueObject from,
com.ivata.mask.valueobject.ValueObject to)
Override to set all property values from one value object to another.
from - value object to take values from.to - value object to set values in.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||