- All Implemented Interfaces:
Serializable,Comparable<RelatedDtoStrategy>,Constable
Defines how related DTOs should be handled when not included as a JOIN in a query.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionFields containing related DTOs will be set to null if not added to the JOIN clauses of a query.Fields containing related DTOs will be partially constructed, containing only the primary key fields, if not added to the JOIN clauses of a query. -
Method Summary
Modifier and TypeMethodDescriptionstatic RelatedDtoStrategyReturns the enum constant of this class with the specified name.static RelatedDtoStrategy[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NULL_IF_NO_JOIN
Fields containing related DTOs will be set to null if not added to the JOIN clauses of a query.This is the default behaviour.
For example, given:
class MyDto { private MyRelatedDto relatedDto; }The related DTO field
relatedDtowill be set to null if not added to the JOIN clauses of a query. -
PARTIAL_OBJECT_IF_NO_JOIN
Fields containing related DTOs will be partially constructed, containing only the primary key fields, if not added to the JOIN clauses of a query.For example, given:
class MyDto { private MyRelatedDto relatedDto; }class MyRelatedDto { // Primary key private Long id; // Other fields private String description; }The related DTO field
relatedDtowill contain an instance ofMyRelatedDtowith only the primary key fieldidset if the JOIN clause doesn't include the @{code relatedDto} field.
-
-
Method Details
-
values
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
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
-