java.lang.Object
st.orm.StormConfig
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringWhether to use ANSI escaping for identifiers.static final StringCache retention mode.static final StringMaximum number of compiled templates to cache.static final StringDefault update mode for entities without@DynamicUpdate.static final StringDefault dirty check strategy.static final StringMaximum UPDATE shapes before fallback to full-row update.static final StringInterpolation safety mode.static final StringRecord validation mode.static final StringSchema validation mode.static final StringWhether to treat schema validation warnings as errors. -
Method Summary
Modifier and TypeMethodDescriptionstatic StormConfigdefaults()Returns a configuration that reads exclusively from JVM system properties.getProperty(String key) Returns the value of the property with the given key.getProperty(String key, String defaultValue) Returns the value of the property with the given key, falling back to the specified default.static StormConfigCreates a newStormConfigwith the given properties.
-
Field Details
-
UPDATE_DEFAULT_MODE
Default update mode for entities without@DynamicUpdate. Values: ENTITY, FIELD, OFF.- See Also:
-
UPDATE_DIRTY_CHECK
Default dirty check strategy. Values: INSTANCE, VALUE.- See Also:
-
UPDATE_MAX_SHAPES
Maximum UPDATE shapes before fallback to full-row update.- See Also:
-
ENTITY_CACHE_RETENTION
Cache retention mode. Values: default, light.- See Also:
-
TEMPLATE_CACHE_SIZE
Maximum number of compiled templates to cache.- See Also:
-
ANSI_ESCAPING
Whether to use ANSI escaping for identifiers.- See Also:
-
VALIDATION_RECORD_MODE
Record validation mode. Values: fail, warn, none.- See Also:
-
VALIDATION_SCHEMA_MODE
Schema validation mode. Values: none, warn, fail.- See Also:
-
VALIDATION_STRICT
Whether to treat schema validation warnings as errors.- See Also:
-
VALIDATION_INTERPOLATION_MODE
Interpolation safety mode. Values: warn, fail, none.- See Also:
-
-
Method Details
-
getProperty
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,
nullis returned.- Parameters:
key- the property key.- Returns:
- the property value, or
nullif not set.
-
getProperty
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
defaultValueif not set.
-
of
Creates a newStormConfigwith the given properties.- Parameters:
properties- the configuration properties; must not benull.- Returns:
- a new immutable configuration.
-
defaults
Returns a configuration that reads exclusively from JVM system properties.This is the default configuration used when no explicit
StormConfigis provided.- Returns:
- the default configuration; never
null.
-