Package org.hibernate.annotations
Enum Class CascadeType
- All Implemented Interfaces:
Serializable
,Comparable<CascadeType>
,Constable
Deprecated, for removal: This API element is subject to removal in a future version.
Enumerates the persistence operations which may be cascaded from
one entity instance to associated entity instances.
This enumeration of cascade types competes with the JPA-defined
enumeration CascadeType
, but offers
additional options, including LOCK
.
To enable cascade LOCK
, use @Cascade
, for
example:
@OneToMany(mappedBy="parent") @Cascade({PERSIST,REFRESH,REMOVE,LOCK}) Set<Child> children;
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionDeprecated, for removal: This API element is subject to removal in a future version.Includes all types listed here.Deprecated, for removal: This API element is subject to removal in a future version.Ancient versions of Hibernate treated orphan removal as a specialized type of cascade.Deprecated, for removal: This API element is subject to removal in a future version.Equivalent toCascadeType.DETACH
.Deprecated, for removal: This API element is subject to removal in a future version.A cascade type for thelock()
operation.Deprecated, for removal: This API element is subject to removal in a future version.Equivalent toCascadeType.MERGE
.Deprecated, for removal: This API element is subject to removal in a future version.Equivalent toCascadeType.PERSIST
.Deprecated, for removal: This API element is subject to removal in a future version.Equivalent toCascadeType.REFRESH
.Deprecated, for removal: This API element is subject to removal in a future version.Equivalent toCascadeType.REMOVE
.Deprecated.sinceSession.replicate(Object, ReplicationMode)
is deprecated -
Method Summary
Modifier and TypeMethodDescriptionstatic CascadeType
Deprecated, for removal: This API element is subject to removal in a future version.Returns the enum constant of this class with the specified name.static CascadeType[]
values()
Deprecated, for removal: This API element is subject to removal in a future version.Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ALL
Deprecated, for removal: This API element is subject to removal in a future version.Includes all types listed here. Equivalent toCascadeType.ALL
. -
PERSIST
Deprecated, for removal: This API element is subject to removal in a future version.Equivalent toCascadeType.PERSIST
.- See Also:
-
MERGE
Deprecated, for removal: This API element is subject to removal in a future version.Equivalent toCascadeType.MERGE
.- See Also:
-
REMOVE
Deprecated, for removal: This API element is subject to removal in a future version.Equivalent toCascadeType.REMOVE
.- See Also:
-
REFRESH
Deprecated, for removal: This API element is subject to removal in a future version.Equivalent toCascadeType.REFRESH
.- See Also:
-
DETACH
Deprecated, for removal: This API element is subject to removal in a future version.Equivalent toCascadeType.DETACH
.- See Also:
-
LOCK
Deprecated, for removal: This API element is subject to removal in a future version.A cascade type for thelock()
operation.This cascade type has no equivalent in JPA.
- See Also:
-
REPLICATE
Deprecated.sinceSession.replicate(Object, ReplicationMode)
is deprecatedA cascade type for thereplicate()
operation. -
DELETE_ORPHAN
Deprecated, for removal: This API element is subject to removal in a future version.Ancient versions of Hibernate treated orphan removal as a specialized type of cascade. But since JPA 1.0, orphan removal is considered a completely separate setting, and may be enabled by annotating a one-to-one or one-to-many association@OneToOne(orphanRemoval=true)
or@OneToMany(orphanRemoval=true)
.- API Note:
- This is now valid only for internal usage.
-
-
Method Details
-
values
Deprecated, for removal: This API element is subject to removal in a future version.Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Deprecated, for removal: This API element is subject to removal in a future version.Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
CascadeType
. This enumeration will be removed to alleviate the duplication in naming.