Project

General

Profile

« Previous | Next » 

Revision e6feb60e

Added by Andreas Kohlbecker about 6 years ago

ref #7206 fixing multiple representations problem in ToOneRelatedEntityReloader

View differences:

src/main/java/eu/etaxonomy/vaadin/mvp/AbstractCdmEditorPresenter.java
8 8
*/
9 9
package eu.etaxonomy.vaadin.mvp;
10 10

  
11
import java.util.ArrayList;
12 11
import java.util.Collection;
13 12
import java.util.EnumSet;
13
import java.util.HashSet;
14 14

  
15 15
import org.apache.log4j.Logger;
16 16
import org.hibernate.HibernateException;
......
51 51
    protected EnumSet<CRUD> crud = null;
52 52

  
53 53

  
54
    private ICdmCacher cache = new CdmTransientEntityCacher(this);
54
    private ICdmCacher cache;
55 55

  
56
    private java.util.Collection<CdmBase> rootEntities = new ArrayList<>();
56
    private java.util.Collection<CdmBase> rootEntities = new HashSet<>();
57 57

  
58 58
    public AbstractCdmEditorPresenter() {
59 59
        super();
......
88 88
            }
89 89
        }
90 90

  
91

  
92
        cache = new CdmTransientEntityCacher(this);
91 93
        cache.put(cdmEntitiy);
92 94
        rootEntities.add(cdmEntitiy);
93 95

  
......
237 239
        return cache;
238 240
    }
239 241

  
240

  
241

  
242 242
    /**
243 243
     * {@inheritDoc}
244 244
     */
245 245
    @Override
246
    public Collection<CdmBase> getRootEntities() {
247
        return rootEntities;
246
    public void addRootEntity(CdmBase entity) {
247
        rootEntities.add(entity);
248 248
    }
249 249

  
250

  
250 251
    /**
251
     * Returns true only after the view method {@link AbstractPopupEditor#loadInEditor()}
252
     * has completed.
253
     *
252
     * {@inheritDoc}
254 253
     */
255 254
    @Override
256
    public boolean isCacheInitialized() {
257
        return ((AbstractPopupEditor)getView()).isBeanLoaded();
255
    public Collection<CdmBase> getRootEntities() {
256
        return rootEntities;
258 257
    }
259 258

  
259

  
260 260
}

Also available in: Unified diff