Record Class SqlDialectOptions

java.lang.Object
java.lang.Record
io.micronaut.data.model.query.builder.sql.SqlDialectOptions
Record Components:
dialect - The dialect these options apply to
version - The target dialect version

@Internal public record SqlDialectOptions(Dialect dialect, Optional<String> version) extends Record
Resolved SQL dialect options used during SQL generation.
  • Field Details

    • ORACLE_26_0_VERSION

      public static final String ORACLE_26_0_VERSION
      Oracle version that enables lock-free reservation generation.
      See Also:
    • DIALECT_OPTIONS_CONFIGURATION_PREFIX

      public static final String DIALECT_OPTIONS_CONFIGURATION_PREFIX
      Annotation processor option prefix for SQL dialect options.
      See Also:
    • MEMBER_VERSION

      public static final String MEMBER_VERSION
      Annotation/configuration member for target dialect version.
      See Also:
  • Constructor Details

    • SqlDialectOptions

      public SqlDialectOptions(Dialect dialect, Optional<String> version)
      Creates dialect options.
      Parameters:
      dialect - The dialect
      version - The target dialect version
  • Method Details

    • defaults

      public static SqlDialectOptions defaults(Dialect dialect)
      Parameters:
      dialect - The dialect
      Returns:
      default options for the dialect
    • of

      public static SqlDialectOptions of(Dialect dialect, @Nullable String version)
      Create options from explicit values.
      Parameters:
      dialect - The dialect
      version - The target dialect version
      Returns:
      resolved dialect options
    • of

      public static SqlDialectOptions of(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, Dialect dialect)
      Resolve options from annotation metadata.
      Parameters:
      annotationMetadata - The annotation metadata
      dialect - The dialect
      Returns:
      resolved dialect options
    • versionConfiguration

      public static String versionConfiguration(Dialect dialect)
      Resolve the annotation processor option key for a dialect target version.
      Parameters:
      dialect - The dialect
      Returns:
      The annotation processor option key
    • isVersionAtLeast

      public boolean isVersionAtLeast(@Nullable String requiredVersion)
      Parameters:
      requiredVersion - The required target dialect version
      Returns:
      true if the configured target dialect version is at least the required version
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • dialect

      public Dialect dialect()
      Returns the value of the dialect record component.
      Returns:
      the value of the dialect record component
    • version

      public Optional<String> version()
      Returns the value of the version record component.
      Returns:
      the value of the version record component