|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--bill.util.persist.EntityData | +--bill.util.persist.EntityDataConfig
This class is used to define an entity and to manipulate the entity in the persistent store. This class uses a PersistConfiguration object as it's persistent store.
Fields inherited from class bill.util.persist.EntityData |
_collectionInfo, _collections, _elements, _entityName, _keys, _state, ET_BOOLEAN, ET_DOUBLE, ET_INTEGER, ET_LONG, ET_OID, ET_REAL, ET_STRING |
Constructor Summary | |
EntityDataConfig()
Creator based on the name of the entity. |
|
EntityDataConfig(String entityName)
Creator based on the name of the entity. |
|
EntityDataConfig(String entityName,
Hashtable keyValues)
Creator based on the name of the entity and the key elements' values. |
Method Summary | |
protected void |
deleteConfigEntry()
Deletes an existing configuration entry in the configuration file. |
protected void |
deleteConfigEntry(boolean nullFileNameOK)
Deletes an existing configuration entry in the configuration file. |
String |
getCollectionClassName()
Returns the class name of the EntityCollection class associated with this class. |
protected void |
insertConfigEntry()
Inserts a new configuration entry into the configuration file. |
protected void |
insertConfigEntry(boolean nullFileNameOK)
Inserts a new configuration entry into the configuration file. |
void |
retrieve(Hashtable keyValues)
Retrieves an entity from the database that is keyed by the given key values. |
int |
save()
Controls the updating of the persistent store with the entity's information. |
int |
save(boolean nullFileNameOK)
Controls the updating of the persistent store with the entity's information. |
void |
setValues(ConfigurationSection entitySection)
Populates the entity's element values from a configuration section. |
protected void |
updateConfigEntry()
Updates an existing configuration entry in the configuration file. |
protected void |
updateConfigEntry(boolean nullFileNameOK)
Updates an existing configuration entry in the configuration file. |
Methods inherited from class bill.util.persist.EntityData |
addElement, containsElement, getCollection, getElement, getElements, getElementValue, getEntityName, getKey, identifyElements, identifyKeyElement, identifyRequiredElement, instantiateCollection, isDeleted, isModified, isNew, registerOneToManyCollection, setClean, setDeleted, setElementValue, setElementValues, setEntityName, setModified, setNew, toString, userValidate, validate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public EntityDataConfig()
public EntityDataConfig(String entityName)
entityName
- The name of the entity.public EntityDataConfig(String entityName, Hashtable keyValues) throws PersistException
entityName
- The name of the entity.keyValues
- The key element's values. Keyed by the element's logical
name, result is the element's value.PersistException
- If a fatal error occurs that causes us to not
be able to perform the retrieval. In our case this would be a
ConfigurationException of some sort.Method Detail |
public void setValues(ConfigurationSection entitySection) throws PersistException
entitySection
- The configuration section to use in populating
the entity.PersistException
- If a fatal error occurs that causes us to not
be able to extract the configuration section's data.protected void insertConfigEntry() throws PersistException
PersistException
- Thrown when the section to be inserted already
exists.protected void insertConfigEntry(boolean nullFileNameOK) throws PersistException
nullFileNameOK
- Indicates if we should throw an exception when
the configuration file has no file name associated with it. A
value of true
indicates we should not throw an exception,
false
indicates we should.PersistException
- Thrown when the section to be inserted already
exists.protected void updateConfigEntry() throws PersistException
PersistException
- Thrown when the section to be updated does not
exist.protected void updateConfigEntry(boolean nullFileNameOK) throws PersistException
nullFileNameOK
- Indicates if we should throw an exception when
the configuration file has no file name associated with it. A
value of true
indicates we should not throw an exception,
false
indicates we should.PersistException
- Thrown when the section to be updated does not
exist.protected void deleteConfigEntry() throws PersistException
PersistException
- Thrown when the section to be deleted does not
exist.protected void deleteConfigEntry(boolean nullFileNameOK) throws PersistException
nullFileNameOK
- Indicates if we should throw an exception when
the configuration file has no file name associated with it. A
value of true
indicates we should not throw an exception,
false
indicates we should.PersistException
- Thrown when the section to be deleted does not
exist.public int save() throws PersistException
save
in class EntityData
PersistException
- If a fatal error occurs that causes us to not
be able to perform the action, such as a failed validation.public int save(boolean nullFileNameOK) throws PersistException
nullFileNameOK
- Indicates if we should throw an exception when
the configuration file has no file name associated with it. A
value of true
indicates we should not throw an exception,
false
indicates we should.PersistException
- If a fatal error occurs that causes us to not
be able to perform the action, such as a failed validation.public void retrieve(Hashtable keyValues) throws PersistException
retrieve
in class EntityData
keyValues
- The key element's values. Keyed by the element's logical
name, result is the element's value.PersistException
- If a fatal error occurs that causes us to not
be able to perform the retrieval. In our case this would be a missing
configuration section, which implies the key values passed in do not
match any of our persisted entities.public String getCollectionClassName()
getCollectionClassName
in class EntityData
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |