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"/> <type name="varchar" length="200"/>
</column> </column>
<column name="config_value"> <column name="config_value">
<type name="varchar" length="200"/> <type name="varchar" length="2000"/>
</column> </column>
<constraint name="config_pk" type="pk-constr" table="public.config"> <constraint name="config_pk" type="pk-constr" table="public.config">
<columns names="application,config_key,config_key_account" ref-type="src-columns"/> <columns names="application,config_key,config_key_account" ref-type="src-columns"/>

View File

@ -8,3 +8,4 @@ DROP TABLE IF EXISTS application_permission CASCADE;
DROP TABLE IF EXISTS application CASCADE; DROP TABLE IF EXISTS application CASCADE;
DROP TABLE IF EXISTS account_history 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

@ -135,6 +135,21 @@ public class ConfigService implements Serializable {
return configValue; 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) @Lock(LockType.READ)
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED) @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public String getConfigValue(String configKey, Account account, boolean fallbackToSystem) throws ConfigException { public String getConfigValue(String configKey, Account account, boolean fallbackToSystem) throws ConfigException {

View File

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