Correctly configure tenant config length. (#680)
Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
This commit is contained in:
@@ -15,6 +15,16 @@ package org.eclipse.hawkbit.repository.model;
|
||||
*/
|
||||
public interface TenantConfiguration extends TenantAwareBaseEntity {
|
||||
|
||||
/**
|
||||
* Maximum length of tenant configuration key.
|
||||
*/
|
||||
int KEY_MAX_SIZE = 128;
|
||||
|
||||
/**
|
||||
* Maximum length of tenant configuration value.
|
||||
*/
|
||||
int VALUE_MAX_SIZE = 512;
|
||||
|
||||
/**
|
||||
* @return key of the entry
|
||||
*/
|
||||
|
||||
@@ -13,7 +13,6 @@ import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.UniqueConstraint;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
@@ -32,14 +31,14 @@ import org.eclipse.hawkbit.repository.model.TenantConfiguration;
|
||||
public class JpaTenantConfiguration extends AbstractJpaTenantAwareBaseEntity implements TenantConfiguration {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Column(name = "conf_key", length = 128, nullable = false, updatable = false)
|
||||
@Size(max = 128)
|
||||
@NotEmpty
|
||||
@Column(name = "conf_key", length = TenantConfiguration.KEY_MAX_SIZE, nullable = false, updatable = false)
|
||||
@Size(min = 1, max = TenantConfiguration.KEY_MAX_SIZE)
|
||||
@NotNull
|
||||
private String key;
|
||||
|
||||
@Column(name = "conf_value", length = 512, nullable = false)
|
||||
@Column(name = "conf_value", length = TenantConfiguration.VALUE_MAX_SIZE, nullable = false)
|
||||
@Basic
|
||||
@Size(max = 512)
|
||||
@Size(max = TenantConfiguration.VALUE_MAX_SIZE)
|
||||
@NotNull
|
||||
private String value;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user