@Target(METHOD)
@Retention(RUNTIME)
public @interface UpdatableMapping
Modifier and Type | Optional Element | Description |
---|---|---|
CascadeType[] |
cascade |
The actions that should cascade for the runtime type of objects assigned to the annotated attribute.
|
boolean |
orphanRemoval |
Specifies whether an element should be deleted when it is removed/replaced in the attribute value.
|
java.lang.Class<?>[] |
persistSubtypes |
Subtypes of the attribute element type that are allowed to receive
CascadeType.PERSIST cascade events. |
java.lang.Class<?>[] |
subtypes |
Subtypes of the attribute element type that are allowed to be receive
CascadeType.PERSIST and CascadeType.UPDATE cascade events. |
boolean |
updatable |
Specifies whether the relation for the attribute is updatable.
|
java.lang.Class<?>[] |
updateSubtypes |
Subtypes of the attribute element type that are allowed to receive
CascadeType.UPDATE cascade events. |
boolean updatable
false
, the relation isn't updated
and the referenced entity unless overridden by cascade() isn't updated either. If it is set to true
, at least the relation updated.
If the attribute maps a *ToMany relation and updatable() is false
, changes to the collection
aren't applied to the collection of the backing entity. If it is set to true
, at least the collection changes are applied.
Unless overridden by this attribute, every attribute that also has a setter is updatable.boolean orphanRemoval
FlushStrategy.ENTITY
flush strategy would behave differently than other strategies,
as the JPA provider would do the orphan removal in case of an update whereas other strategies would adhere to the orphan removal defined on this attribute.CascadeType[] cascade
The default strategy CascadeType.AUTO
causes that attributes that are mutable to cascade all changes.
Updatable and non-updatable attributes that have a non-mutable/immutable type do not cascade changes by default.
An updatable attribute with a non-mutable type can define cascading so that objects of a subtype are persisted or updated. A mutable attribute can be excluded from persisting or updating by annotating an empty array of cascade types.
java.lang.Class<?>[] subtypes
CascadeType.PERSIST
and CascadeType.UPDATE
cascade events.java.lang.Class<?>[] persistSubtypes
CascadeType.PERSIST
cascade events.java.lang.Class<?>[] updateSubtypes
CascadeType.UPDATE
cascade events.Copyright © 2014–2018 Blazebit. All rights reserved.