Revision 998a72e0
Added by Andreas Kohlbecker about 5 years ago
src/main/java/eu/etaxonomy/vaadin/mvp/CdmEditorPresenterBase.java | ||
---|---|---|
93 | 93 |
logger.trace(this._toString() + " constructor"); |
94 | 94 |
} |
95 | 95 |
|
96 |
CdmStore<CDM, IService<CDM>> store ; |
|
96 |
@Autowired |
|
97 |
protected CdmStore cdmStore; |
|
97 | 98 |
|
98 | 99 |
protected CdmAuthority newAuthorityCreated; |
99 | 100 |
|
100 |
|
|
101 |
protected CdmStore<CDM, IService<CDM>> getStore() { |
|
102 |
if(store == null){ |
|
103 |
store = new CdmStore<>(getRepo(), getService()); |
|
104 |
} |
|
105 |
return store; |
|
106 |
} |
|
107 |
|
|
108 | 101 |
@Override |
109 | 102 |
protected DTO loadBeanById(Object identifier) { |
110 | 103 |
|
... | ... | |
232 | 225 |
EntityChangeEvent<?> changeEvent = null; |
233 | 226 |
try { |
234 | 227 |
dto = preSaveBean(dto); |
235 |
changeEvent = getStore().saveBean(cdmEntity, (AbstractView<?>) getView());
|
|
228 |
changeEvent = cdmStore.saveBean(cdmEntity, (AbstractView<?>) getView());
|
|
236 | 229 |
|
237 | 230 |
if(changeEvent != null){ |
238 | 231 |
viewEventBus.publish(this, changeEvent); |
... | ... | |
294 | 287 |
@Override |
295 | 288 |
protected void deleteBean(DTO bean){ |
296 | 289 |
CDM cdmEntity = cdmEntity(bean); |
297 |
EntityChangeEvent changeEvent = getStore().deleteBean(cdmEntity, (AbstractView) getView());
|
|
290 |
EntityChangeEvent changeEvent = cdmStore.deleteBean(cdmEntity, (AbstractView) getView());
|
|
298 | 291 |
if(changeEvent != null){ |
299 | 292 |
viewEventBus.publish(this, changeEvent); |
300 | 293 |
} |
Also available in: Unified diff
ref #7106 refactoring CdmStore in turn of changed CdmRepository.getSession()