Methods Summary |
---|
public void | addAdditionChange(java.util.HashMap additions)ADVANCED:
Adds the items that were added to the collection
if (getAddObjects().size() == 0) {
addObjectsList = additions;
return;
}
for (Iterator i = additions.keySet().iterator(); i.hasNext(); ) {
Object key = i.next();
if (getAddObjects().containsKey(key)) {
getAddObjects().put(key, additions.get(key));
} else if (additions.get(key).equals(getAddObjects().get(key))) {
getAddObjects().put(key, additions.get(key));
}
}
|
public void | addAdditionChange(java.lang.Object key, java.lang.Object value)ADVANCED:
Adds the items that were added to the collection
if ( getRemoveObjects().containsKey(key) ) {
if ( value.equals(getRemoveObjects().get(key)) ) {
getRemoveObjects().remove(key);
}else {
getAddObjects().put(key, value);
}
} else {
getAddObjects().put(key, value);
}
|
public void | addRemoveChange(java.util.HashMap subtractions)ADVANCED:
Adds the items that were removed from the collection
if (getRemoveObjects().size() == 0) {
this.removeObjectsList = subtractions;
return;
}
for (Iterator i = subtractions.keySet().iterator(); i.hasNext(); ) {
Object key = i.next();
if (!getRemoveObjects().containsKey(key)) {
getRemoveObjects().put(key, subtractions.get(key));
} else if (subtractions.get(key).equals(getRemoveObjects().get(key))) {
getRemoveObjects().put(key, subtractions.get(key));
}
}
|
public void | addRemoveChange(java.lang.Object key, java.lang.Object value)ADVANCED:
Adds the items that were removed from the collection
//if an entry already exists in the remove it must remain untill added
// as it contains the original removal.
if ( getAddObjects().containsKey(key) ) {
getAddObjects().remove(key);
}else if ( ! getRemoveObjects().containsKey(key) ) {
getRemoveObjects().put(key, value);
}
|
public java.util.Vector | getAddAssociations()INTERNAL:
Use in SDK propject for the mapping of this change record
Vector addAssociations = new Vector();
for (Iterator i = getAddObjects().keySet().iterator(); i.hasNext(); ) {
Association association = new Association();
Object key = i.next();
Object value = getAddObjects().get(key);
association.setKey(key);
association.setValue(value);
addAssociations.add(association);
}
if (addAssociations.size() == 0) {
return null;
}
return addAssociations;
|
public java.util.HashMap | getAddObjects()INTERNAL:
Returns the added items list
if (addObjectsList == null) {
// addObjectsList = new Hashtable();
addObjectsList = new HashMap();
}
return addObjectsList;
|
public java.lang.Object | getLatestCollection()Used for change tracking when cutomer sets entire collection
This is the last collection that was set on the object
return latestCollection;
|
public java.lang.Object | getOriginalCollection()Used for change tracking when cutomer sets entire collection
This is the original collection that was set on the object when it was cloned
return originalCollection;
|
public java.util.Vector | getRemoveAssociations()INTERNAL:
Use in SDK propject for the mapping of this change record
Vector removeAssociations = new Vector();
for (Iterator i = getRemoveObjects().keySet().iterator(); i.hasNext(); ) {
Association association = new Association();
Object key = i.next();
Object value = getAddObjects().get(key);
association.setKey(key);
association.setValue(value);
removeAssociations.add(association);
}
if (removeAssociations.size() == 0) {
return null;
}
return removeAssociations;
|
public java.util.HashMap | getRemoveObjects()INTERNAL:
Returns the removed items list
if (removeObjectsList == null) {
removeObjectsList = new HashMap();
}
return removeObjectsList;
|
public boolean | hasChanges()returns true if the change set has changes
return (!(getAddObjects().isEmpty() && getRemoveObjects().isEmpty())) || getOwner().isNew();
|
public void | mergeRecord(oracle.toplink.essentials.internal.sessions.ChangeRecord mergeFromRecord, oracle.toplink.essentials.internal.sessions.UnitOfWorkChangeSet mergeToChangeSet, oracle.toplink.essentials.internal.sessions.UnitOfWorkChangeSet mergeFromChangeSet)INTERNAL:
This method will be used to merge one record into another
Iterator addKeys = ((DirectMapChangeRecord)mergeFromRecord).getAddObjects().keySet().iterator();
while (addKeys.hasNext()) {
Object key = addKeys.next();
if (!this.getAddObjects().containsKey(key)) {
if (this.getRemoveObjects().containsKey(key)) {
this.getRemoveObjects().remove(key);
} else {
this.getAddObjects().put(key, ((DirectMapChangeRecord)mergeFromRecord).getAddObjects().get(key));
}
}
}
Iterator removeKeys = ((DirectMapChangeRecord)mergeFromRecord).getRemoveObjects().keySet().iterator();
while (removeKeys.hasNext()) {
Object key = removeKeys.next();
if (!this.getRemoveObjects().containsKey(key)) {
if (this.getAddObjects().containsKey(key)) {
this.getAddObjects().remove(key);
} else {
this.getRemoveObjects().put(key, ((DirectMapChangeRecord)mergeFromRecord).getRemoveObjects().get(key));
}
}
}
|
public void | setAddAssociations(java.util.Vector addAssociations)INTERNAL:
Use in SDK propject for the mapping of this change record
HashMap addMap = new HashMap();
for (Enumeration enumtr = addAssociations.elements(); enumtr.hasMoreElements();) {
Association association = (Association)enumtr.nextElement();
addMap.put(association.getKey(), association.getValue());
}
if (addMap.isEmpty()) {
addObjectsList = null;
}
addObjectsList = addMap;
|
public void | setAddObjects(java.util.HashMap addObjects)INTERNAL:
Sets the added items list
this.addObjectsList = addObjects;
|
public void | setLatestCollection(java.lang.Object latestCollection)Used for change tracking when cutomer sets entire collection
This is the last collection that was set on the object
this.latestCollection = latestCollection;
|
public void | setOriginalCollection(java.lang.Object originalCollection)Used for change tracking when cutomer sets entire collection
This is the original collection that was set on the object when it was cloned
this.originalCollection = originalCollection;
|
public void | setRemoveAssociations(java.util.Vector removeAssociations)INTERNAL:
Use in SDK propject for the mapping of this change record
HashMap removeMap = new HashMap();
for (Enumeration enumtr = removeAssociations.elements(); enumtr.hasMoreElements();) {
Association association = (Association)enumtr.nextElement();
removeMap.put(association.getKey(), association.getValue());
}
if (removeMap.isEmpty()) {
removeObjectsList = null;
}
removeObjectsList = removeMap;
|
public void | setRemoveObjects(java.util.HashMap removeObjects)INTERNAL:
Sets the removed items list
this.removeObjectsList = removeObjects;
|
public void | updateReferences(oracle.toplink.essentials.internal.sessions.UnitOfWorkChangeSet mergeToChangeSet, oracle.toplink.essentials.internal.sessions.UnitOfWorkChangeSet mergeFromChangeSet)INTERNAL:
This method will be used to update the objectsChangeSets references
//nothing for this record type to do as it does not reference any changesets
|