Package st.orm

Class StormConfig

java.lang.Object
st.orm.StormConfig

public final class StormConfig extends Object
Immutable, untyped configuration for the Storm ORM framework.

A StormConfig holds an immutable set of String key-value properties. Property keys use the same names as the corresponding JVM system properties (e.g. storm.update.default_mode). When a requested key is not present in the property map, the lookup falls back to System.getProperty(String), so existing JVM flag users are unaffected.

Usage

Programmatic configuration:


 StormConfig config = StormConfig.of(Map.of(
     StormConfig.UPDATE_DEFAULT_MODE, "FIELD",
     StormConfig.UPDATE_MAX_SHAPES, "10"
 ));
 ORMTemplate orm = ORMTemplate.of(dataSource, config);
 

When no configuration is provided, ORMTemplate.of(dataSource) uses defaults(), which reads exclusively from system properties.

Since:
1.9
  • Field Details

    • UPDATE_DEFAULT_MODE

      public static final String UPDATE_DEFAULT_MODE
      Default update mode for entities without @DynamicUpdate. Values: ENTITY, FIELD, OFF.
      See Also:
    • UPDATE_DIRTY_CHECK

      public static final String UPDATE_DIRTY_CHECK
      Default dirty check strategy. Values: INSTANCE, VALUE.
      See Also:
    • UPDATE_MAX_SHAPES

      public static final String UPDATE_MAX_SHAPES
      Maximum UPDATE shapes before fallback to full-row update.
      See Also:
    • ENTITY_CACHE_RETENTION

      public static final String ENTITY_CACHE_RETENTION
      Cache retention mode. Values: default, light.
      See Also:
    • TEMPLATE_CACHE_SIZE

      public static final String TEMPLATE_CACHE_SIZE
      Maximum number of compiled templates to cache.
      See Also:
    • ANSI_ESCAPING

      public static final String ANSI_ESCAPING
      Whether to use ANSI escaping for identifiers.
      See Also:
    • VALIDATION_RECORD_MODE

      public static final String VALIDATION_RECORD_MODE
      Record validation mode. Values: fail, warn, none.
      See Also:
    • VALIDATION_SCHEMA_MODE

      public static final String VALIDATION_SCHEMA_MODE
      Schema validation mode. Values: none, warn, fail.
      See Also:
    • VALIDATION_STRICT

      public static final String VALIDATION_STRICT
      Whether to treat schema validation warnings as errors.
      See Also:
    • VALIDATION_INTERPOLATION_MODE

      public static final String VALIDATION_INTERPOLATION_MODE
      Interpolation safety mode. Values: warn, fail, none.
      See Also:
  • Method Details

    • getProperty

      @Nullable public String getProperty(@Nonnull String key)
      Returns the value of the property with the given key.

      If the key is present in the property map, its value is returned. Otherwise, the value of the corresponding JVM system property is returned. If neither is set, null is returned.

      Parameters:
      key - the property key.
      Returns:
      the property value, or null if not set.
    • getProperty

      @Nonnull public String getProperty(@Nonnull String key, @Nonnull String defaultValue)
      Returns the value of the property with the given key, falling back to the specified default.
      Parameters:
      key - the property key.
      defaultValue - the default value to return if the property is not set.
      Returns:
      the property value, or defaultValue if not set.
    • of

      @Nonnull public static StormConfig of(@Nonnull Map<String,String> properties)
      Creates a new StormConfig with the given properties.
      Parameters:
      properties - the configuration properties; must not be null.
      Returns:
      a new immutable configuration.
    • defaults

      @Nonnull public static StormConfig defaults()
      Returns a configuration that reads exclusively from JVM system properties.

      This is the default configuration used when no explicit StormConfig is provided.

      Returns:
      the default configuration; never null.