enlarged config value size

This commit is contained in:
Joern Muehlencord
2019-09-02 15:47:04 +02:00
parent 0cbab859f8
commit 97649c9306
4 changed files with 19 additions and 3 deletions

View File

@ -27,7 +27,7 @@ CAUTION: Do not modify this file unless you know what you are doing.
<type name="varchar" length="200"/>
</column>
<column name="config_value">
<type name="varchar" length="200"/>
<type name="varchar" length="2000"/>
</column>
<constraint name="config_pk" type="pk-constr" table="public.config">
<columns names="application,config_key,config_key_account" ref-type="src-columns"/>

View File

@ -7,4 +7,5 @@ DROP TABLE IF EXISTS application_role CASCADE;
DROP TABLE IF EXISTS application_permission CASCADE;
DROP TABLE IF EXISTS application CASCADE;
DROP TABLE IF EXISTS account_history CASCADE;
DROP TABLE IF EXISTS mail_template CASCADE;
DROP TABLE IF EXISTS mail_template CASCADE;
DROP TABLE IF EXISTS api_key CASCADE;

View File

@ -134,6 +134,21 @@ public class ConfigService implements Serializable {
return configValue;
}
@Lock(LockType.READ)
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public String getConfigValue(String configKey, String defaultValue, String accountName, boolean fallbackToSystem) throws ConfigException {
Account account = getAccount(accountName);
if (account == null) {
if (fallbackToSystem) {
return getConfigValue (configKey);
} else {
return defaultValue;
}
} else {
return getConfigValue (configKey, account, fallbackToSystem);
}
}
@Lock(LockType.READ)
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)

View File

@ -71,7 +71,7 @@ public class ConfigEntity implements Serializable {
@EmbeddedId
protected ConfigEntityPK configPK;
@Size(max = 200)
@Size(max = 2000)
@Column(name = "config_value")
private String configValue;
@Size(max = 200)