@Retention(value=RUNTIME) @Target(value={METHOD,ANNOTATION_TYPE}) @Documented public @interface Modifying
Indicates a query method should be considered as modifying query as that changes the way it needs to be executed.
This annotation is only considered if used on query methods defined through a Query
annotation. It's not
applied on custom implementation methods or queries derived from the method name as they already have control over
the underlying data access APIs or specify if they are modifying by their name.
Queries that require a `@Modifying` annotation include INSERT
, UPDATE
, DELETE
, and DDL
statements.
Query
Modifier and Type | Optional Element and Description |
---|---|
boolean |
clearAutomatically
Defines whether we should clear the underlying persistence context after executing the modifying query.
|
boolean |
flushAutomatically
Defines whether we should flush the underlying persistence context before executing the modifying query.
|
Copyright © 2011–2020 Pivotal Software, Inc.. All rights reserved.