Collection<DirtyObjectID> res = null;
PersistenceManager pm = event.getPersistenceManager();
iterateDirtyObjectIDs: for (DirtyObjectID dirtyObjectID : event.getDirtyObjectIDs()) {
boolean add = false;
Article article = null;
try {
article = (Article) pm.getObjectById(dirtyObjectID.getObjectID());
} catch (JDOObjectNotFoundException x) {
// the object has already been deleted => we ignore it if this filter isn't for deleted objects (which it should never be as deletion should tracked using implicit listeners as best practice)
for (JDOLifecycleState state : jdoLifecycleStates) {
if (JDOLifecycleState.DELETED.equals(state))
add = true;
else
continue iterateDirtyObjectIDs;
}
}
if (articleContainerID instanceof OrderID) {
if (articleContainerID.equals(article.getOrderID()))
add = true;
}
else if (articleContainerID instanceof OfferID) {
if (articleContainerID.equals(article.getOfferID()))
add = true;
}
else if (articleContainerID instanceof InvoiceID) {
if (articleContainerID.equals(article.getInvoiceID()))
add = true;
}
else if (articleContainerID instanceof DeliveryNoteID) {
if (articleContainerID.equals(article.getDeliveryNoteID()))
add = true;
}
else
throw new IllegalStateException("articleContainerID is an instance of an unsupported class: " + articleContainerID);