Package org.hibernate.annotations
Enum Class CascadeType
- All Implemented Interfaces:
Serializable
,Comparable<CascadeType>
,Constable
Deprecated.
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.Includes all types listed here.Deprecated.Ancient versions of Hibernate treated orphan removal as a specialized type of cascade.Deprecated.Equivalent toCascadeType.DETACH
.Deprecated.A cascade type for thelock()
operation.Deprecated.Equivalent toCascadeType.MERGE
.Deprecated.Equivalent toCascadeType.PERSIST
.Deprecated.Equivalent toCascadeType.REFRESH
.Deprecated.Equivalent toCascadeType.REMOVE
.Deprecated.sinceSession.replicate(Object, ReplicationMode)
is deprecated -
Method Summary
Modifier and TypeMethodDescriptionstatic CascadeType
Deprecated.Returns the enum constant of this class with the specified name.static CascadeType[]
values()
Deprecated.Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ALL
Deprecated.Includes all types listed here. Equivalent toCascadeType.ALL
. -
PERSIST
Deprecated.Equivalent toCascadeType.PERSIST
.- See Also:
-
MERGE
Deprecated.Equivalent toCascadeType.MERGE
.- See Also:
-
REMOVE
Deprecated.Equivalent toCascadeType.REMOVE
.- See Also:
-
REFRESH
Deprecated.Equivalent toCascadeType.REFRESH
.- See Also:
-
DETACH
Deprecated.Equivalent toCascadeType.DETACH
.- See Also:
-
LOCK
Deprecated.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.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.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.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