297System Parameters
Business settings with a data type and an allowed range, read by the program with typed getters.
Try it
Reading parameters in Java
Values are text in SQL Server; the typed getters turn them into int, BigDecimal, boolean, LocalDate| Java call | Returns | Allowed | |
|---|---|---|---|
| parameterService.getInt("FISCAL_YEAR_START_MONTH") | 10 (Integer) | 1 β¦ 12 | |
| parameterService.getInt("ROUNDING_DECIMALS") | 2 (Integer) | 0 β¦ 4 | |
| parameterService.getString("COMPANY_NAME") | Study Co., Ltd. (String) | ||
| parameterService.getDate("GO_LIVE_DATE") | 2026-01-01 (LocalDate) | π | |
| parameterService.getString("SUPPORT_EMAIL") | support@example.com (String) | ||
| parameterService.getBoolean("ALLOW_NEGATIVE_STOCK") | false (Boolean) | ||
| parameterService.getInt("LOW_STOCK_ALERT") | 10 (Integer) | 0 β¦ 100000 | |
| parameterService.getInt("DEFAULT_CREDIT_DAYS") | 30 (Integer) | 0 β¦ 365 | |
| parameterService.getDecimal("MAX_DISCOUNT_PERCENT") | 15 (BigDecimal) | 0 β¦ 100 | |
| parameterService.getBoolean("VAT_REGISTERED") | true (Boolean) | ||
| parameterService.getInt("PASSWORD_MIN_LENGTH") | 8 (Integer) | 6 β¦ 64 | |
| parameterService.getInt("SESSION_TIMEOUT_MINUTES") | 30 (Integer) | 5 β¦ 480 |
ParameterService.raw() is @Cacheable("parameters"): only the first read of a key queries SQL Server.
Saving a parameter clears the cache (MasterListeners.clearCaches). Try saving DEFAULT_CREDIT_DAYS = 500 to see the range check.
| # | Group | Key | Value | Data type | Editable | Status | |
|---|---|---|---|---|---|---|---|
| 10 | Accounting | FISCAL_YEAR_START_MONTH | 10 | INT | β | Active | βοΈ |
| 9 | Accounting | ROUNDING_DECIMALS | 2 | INT | β | Active | βοΈ |
| 1 | General | COMPANY_NAME | Study Co., Ltd. | STRING | β | Active | βοΈ |
| 3 | General | GO_LIVE_DATE | 2026-01-01 | DATE | Active | βοΈ | |
| 2 | General | SUPPORT_EMAIL | support@example.com | STRING | β | Active | βοΈ |
| 8 | Inventory | ALLOW_NEGATIVE_STOCK | false | BOOLEAN | β | Active | βοΈ |
| 7 | Inventory | LOW_STOCK_ALERT | 10 | INT | β | Active | βοΈ |
| 4 | Sales | DEFAULT_CREDIT_DAYS | 30 | INT | β | Active | βοΈ |
| 5 | Sales | MAX_DISCOUNT_PERCENT | 15 | DECIMAL | β | Active | βοΈ |
| 6 | Sales | VAT_REGISTERED | true | BOOLEAN | β | Active | βοΈ |
| 11 | Security | PASSWORD_MIN_LENGTH | 8 | INT | β | Active | βοΈ |
| 12 | Security | SESSION_TIMEOUT_MINUTES | 30 | INT | β | Active | βοΈ |
Showing 1β12 of 12
π Learn: how this master is built table system_parameter
Key points
- ParameterService.getInt("DEFAULT_CREDIT_DAYS") - typed access to a text column.
- @Cacheable("parameters"): the second read comes from memory, not SQL Server.
Code
- Entity
domain/SystemParameter.java- Repository
repo/SystemParameterRepository.java- Definition
MasterRegistry: "parameters"- Page / form
web/MasterController.java- Try-it panel
templates/tools/parameter-read.html- REST API
GET /api/parameters/DEFAULT_CREDIT_DAYS
SQL to try in SSMS (database MasterDataLabDB)
SELECT param_key, param_value, data_type FROM system_parameter WHERE param_group = 'SALES';