|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jlf.dataMap.DataMapper | +--org.jlf.dataMap.CRUDDataMapper
This class is used as the base of all data mapping mechanisms that can do full CRUD (Create, Read, Update, Delete) in the data mapping framework. Some mechanisms (like XML to a file) don't support update/delete, just create/write, and this won't need this class.
DataLocation
,
DataMappedObject
,
DataMapper
Field Summary | |
protected java.util.Vector |
postCommitUpdateObjects
Holds a collection of objects used to do post-commit updates. |
Fields inherited from class org.jlf.dataMap.DataMapper |
dataArray, dataLocation |
Constructor Summary | |
CRUDDataMapper()
Allow the default constructor, please use a parameterized constructor! |
|
CRUDDataMapper(DataLocation dataLocation)
Constructs a new data mapper which references back to the DataLocation who created it. |
Method Summary | |
protected void |
addPostCommitUpdate(DataMappedObject dmo)
Adds a data mapped object to a collection of objects to be updated after a successful commit to the data sink. |
void |
commitWrites()
Updates objects in the postCommitUpdateObjects collection after a successful commit. |
abstract void |
create(DataMappedObject dmo,
Relationship relationship)
This method is an abstract method that must be overridden to support object creation in the data location. |
abstract void |
delete(DataMappedObject dmo,
Relationship relationship)
This method is an abstract method that must be overridden to support deletions of an object already created in the data location. |
abstract void |
update(DataMappedObject dmo,
Relationship relationship)
This method is an abstract method that must be overridden to support updates to objects already existing in the data location. |
void |
write(DataMappedObject dmo,
Relationship relationship)
This method is an abstract method for the purpose of writing a data mapped object, potentially in the context of a relationship, to a data store. |
void |
writeWithoutCascade(DataMappedObject dmo,
Relationship relationship)
Helper method to split up the write of an object to the correct create, update, or delete method. |
Methods inherited from class org.jlf.dataMap.DataMapper |
close, findBySearchCriteria, findDataAttributeForReplacementString, getCascadedRelationships, getDataLocation, replaceAttributeParameters, rollbackWrites, setDataLocation, stringForDataAttributeReplacement |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.Vector postCommitUpdateObjects
Constructor Detail |
public CRUDDataMapper()
public CRUDDataMapper(DataLocation dataLocation)
DataLocation
who created it.
Method Detail |
protected void addPostCommitUpdate(DataMappedObject dmo)
public void commitWrites()
commitWrites
in class DataMapper
public void write(DataMappedObject dmo, Relationship relationship)
This method cascades relationships if identified by the mapping properties file.
The relationship can be null if not in context of a relationship.
write
in class DataMapper
public void writeWithoutCascade(DataMappedObject dmo, Relationship relationship)
The relationship can be null if not in context of a relationship.
public abstract void create(DataMappedObject dmo, Relationship relationship)
public abstract void update(DataMappedObject dmo, Relationship relationship)
public abstract void delete(DataMappedObject dmo, Relationship relationship)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |