Enum Class RelatedDtoStrategy

java.lang.Object
java.lang.Enum<RelatedDtoStrategy>
org.litebridgedb.orm.config.RelatedDtoStrategy
All Implemented Interfaces:
Serializable, Comparable<RelatedDtoStrategy>, Constable

public enum RelatedDtoStrategy extends Enum<RelatedDtoStrategy>
Defines how related DTOs should be handled when not included as a JOIN in a query.
  • Enum Constant Details

    • NULL_IF_NO_JOIN

      public static final RelatedDtoStrategy 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 relatedDto will be set to null if not added to the JOIN clauses of a query.

    • PARTIAL_OBJECT_IF_NO_JOIN

      public static final RelatedDtoStrategy 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 relatedDto will contain an instance of MyRelatedDto with only the primary key field id set if the JOIN clause doesn't include the @{code relatedDto} field.

  • Method Details

    • values

      public static RelatedDtoStrategy[] 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

      public static RelatedDtoStrategy valueOf(String name)
      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 name
      NullPointerException - if the argument is null