import java.util.Collections;
import java.util.Date;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
public boolean publishes(final Document doc) {
boolean res = false;
long index = doc.getIndex();
- for (Iterator<Publication> i = docums.iterator(); i.hasNext();) {
- Document found = i.next().value();
+ for (Publication pub : docums) {
+ Document found = pub.value();
res = (found.getIndex() == index);
if (res) {
break;
* @return the project element study
*/
public abstract Study getOwnerStudy();
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.splat.dal.bo.kernel.Entity#evict()
+ */
+ @Override
+ public void evict() {
+ super.evict();
+ // Evict all attributes of the persistent object
+ Set<Publication> tmpSet = new HashSet<Publication>();
+ tmpSet.addAll(docums);
+ docums.clear();
+ // Evict publications
+ for (Publication rel : tmpSet) {
+ if (rel.isSaved()) { // to avoid recursive evict
+ rel.evict();
+ }
+ docums.add(rel);
+ }
+ }
}
\ No newline at end of file