Project

General

Profile

« Previous | Next » 

Revision c77f6466

Added by Cherian Mathew over 8 years ago

#5309, #5310 Switch on write transaction annotation for delete, Add load methof for updating session cache

View differences:

cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/IService.java
306 306
     */
307 307
    public UUID update(T transientObject);
308 308

  
309
    /**
310
     * Simply calls the load method.
311
     * Required specifically for the editor to allow load calls which
312
     * can also update the session cache.
313
     *
314
     * @param uuid
315
     * @return
316
     */
317
    public T loadWithUpdate(UUID uuid);
318

  
309 319
    /**
310 320
     * Method that lists the objects matching the example provided.
311 321
     * The includeProperties property is used to specify which properties of the example are used.
......
390 400
     */
391 401
    public MergeResult<T> merge(T newInstance, boolean returnTransientEntity);
392 402

  
393

  
394

  
395

  
396

  
397 403
}
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/ServiceBase.java
162 162
        return uuid == null ? null : dao.load(uuid);
163 163
    }
164 164

  
165
    @Override
166
    @Transactional(readOnly = true)
167
    public T loadWithUpdate(UUID uuid) {
168
        return load(uuid);
169
    }
170

  
165 171
    @Override
166 172
    @Transactional(readOnly = true)
167 173
    public T load(UUID uuid, List<String> propertyPaths){
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/UserService.java
492 492
     * ================================================ */
493 493

  
494 494
    @Override
495
    @Transactional(readOnly=false)
495 496
    @PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_USER_MANAGER')")
496 497
    public DeleteResult delete(User persistentObject)  {
497 498
        return super.delete(persistentObject);
498 499
    }
499 500

  
500 501
    @Override
502
    @Transactional(readOnly=false)
501 503
    public DeleteResult delete(UUID userUuid)  {
502 504
        return delete(dao.load(userUuid));
503 505
    }
504 506

  
505 507
    @Override
508
    @Transactional(readOnly=false)
506 509
    @PreAuthorize("hasRole('ROLE_ADMIN') or hasRole('ROLE_USER_MANAGER')")
507 510
    public Map<UUID, User> save(Collection<User> newInstances) {
508 511
        Map<UUID, User> users = new HashMap<UUID, User>();

Also available in: Unified diff