Files
hibernate-demo/docs/output/24-bulk-update-bypass.txt
T

6 lines
681 B
Plaintext

$ mvn -o -B test -Dtest=InterceptorTest#bulkHqlUpdate_bypassesInterceptorCallbacksEntirely
(trimmed to the generated SQL and the test's own RESULT line)
update task t1_0 set name='renamed by bulk update' where t1_0.id=?
RESULT[interceptor-bulk-update-bypass]: onSaveCalls after the initial insert=1 | onFlushDirtyCalls after a bulk 'update Task set name = ...' executeUpdate()=0 (still 0) | actual persisted name: 'renamed by bulk update' -- the bulk HQL statement changed the row directly in the database without loading a Task instance into the persistence context at all, so onFlushDirty (which needs a managed entity's dirty state to fire against) never had anything to call.