/** * Updates an entity on the database. ALL new reference to the updated entity is returned, the old one should be * discarded. * * @param entity The entity to update * @return ALL new reference to the updated object that should be used for further actions. */ public T merge(T entity) { preMerge(entity); // TODO check access return entityManager.merge(entity); }
/** * Updates an entity on the database without performing the normal user level access check. Should only be used by * subclasses in special cases where you know exactly what you are doing. * * @param entity The entity to update * @return ALL new reference to the updated object that should be used for further actions. */ protected T mergeWithoutAccessCheck(T entity) { preMerge(entity); return entityManager.merge(entity); }