Fixed entity content validation.
Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
This commit is contained in:
@@ -131,7 +131,7 @@ public interface SoftwareManagement {
|
||||
* @return created {@link Entity}
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_CREATE_REPOSITORY)
|
||||
List<SoftwareModuleType> createSoftwareModuleType(@NotNull final Collection<SoftwareModuleType> types);
|
||||
List<SoftwareModuleType> createSoftwareModuleType(@NotNull Collection<SoftwareModuleType> types);
|
||||
|
||||
/**
|
||||
* Creates new {@link SoftwareModuleType}.
|
||||
@@ -483,21 +483,20 @@ public interface SoftwareManagement {
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_UPDATE_REPOSITORY)
|
||||
SoftwareModuleType updateSoftwareModuleType(@NotNull SoftwareModuleType sm);
|
||||
|
||||
|
||||
/**
|
||||
* Finds all meta data by the given software module id.
|
||||
*
|
||||
* @param softwareModuleId
|
||||
* the software module id to retrieve the meta data from
|
||||
|
||||
*
|
||||
*
|
||||
* @throws RSQLParameterUnsupportedFieldException
|
||||
* if a field in the RSQL string is used but not provided by the
|
||||
* given {@code fieldNameProvider}
|
||||
* @throws RSQLParameterSyntaxException
|
||||
* if the RSQL syntax is wrong
|
||||
* @return result of all meta data entries for a given software
|
||||
* module id.
|
||||
* @return result of all meta data entries for a given software module id.
|
||||
*/
|
||||
@PreAuthorize(SpringEvalExpressions.HAS_AUTH_READ_REPOSITORY)
|
||||
List<SoftwareModuleMetadata> findSoftwareModuleMetadataBySoftwareModuleId(Long softwareModuleId);
|
||||
|
||||
@@ -12,6 +12,8 @@ import javax.persistence.Basic;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.MappedSuperclass;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.MetaData;
|
||||
|
||||
@@ -25,9 +27,12 @@ public abstract class AbstractJpaMetaData implements MetaData {
|
||||
|
||||
@Id
|
||||
@Column(name = "meta_key", length = 128)
|
||||
@Size(min = 1, max = 128)
|
||||
@NotNull
|
||||
private String key;
|
||||
|
||||
@Column(name = "meta_value", length = 4000)
|
||||
@Size(max = 4000)
|
||||
@Basic
|
||||
private String value;
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@ package org.eclipse.hawkbit.repository.jpa.model;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.MappedSuperclass;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.NamedEntity;
|
||||
import org.eclipse.hawkbit.repository.model.TenantAwareBaseEntity;
|
||||
@@ -26,9 +28,12 @@ public abstract class AbstractJpaNamedEntity extends AbstractJpaTenantAwareBaseE
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Column(name = "name", nullable = false, length = 64)
|
||||
@Size(max = 64)
|
||||
@NotNull
|
||||
private String name;
|
||||
|
||||
@Column(name = "description", nullable = true, length = 512)
|
||||
@Size(max = 512)
|
||||
private String description;
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,6 +10,8 @@ package org.eclipse.hawkbit.repository.jpa.model;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.MappedSuperclass;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.NamedEntity;
|
||||
import org.eclipse.hawkbit.repository.model.NamedVersionedEntity;
|
||||
@@ -26,6 +28,8 @@ public abstract class AbstractJpaNamedVersionedEntity extends AbstractJpaNamedEn
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Column(name = "version", nullable = false, length = 64)
|
||||
@Size(max = 64)
|
||||
@NotNull
|
||||
private String version;
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,6 +10,7 @@ package org.eclipse.hawkbit.repository.jpa.model;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.MappedSuperclass;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.Tag;
|
||||
|
||||
@@ -26,6 +27,7 @@ public abstract class AbstractJpaTag extends AbstractJpaNamedEntity implements T
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Column(name = "colour", nullable = true, length = 16)
|
||||
@Size(max = 16)
|
||||
private String colour;
|
||||
|
||||
protected AbstractJpaTag() {
|
||||
|
||||
@@ -11,6 +11,7 @@ package org.eclipse.hawkbit.repository.jpa.model;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.MappedSuperclass;
|
||||
import javax.persistence.PrePersist;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import org.eclipse.hawkbit.repository.exception.TenantNotExistException;
|
||||
import org.eclipse.hawkbit.repository.jpa.model.helper.SystemManagementHolder;
|
||||
@@ -31,6 +32,7 @@ public abstract class AbstractJpaTenantAwareBaseEntity extends AbstractJpaBaseEn
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Column(name = "tenant", nullable = false, insertable = false, updatable = false, length = 40)
|
||||
@Size(max = 40)
|
||||
private String tenant;
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,6 +27,7 @@ import javax.persistence.NamedEntityGraphs;
|
||||
import javax.persistence.NamedSubgraph;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.Table;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.ActionCreatedEvent;
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.ActionPropertyChangeEvent;
|
||||
@@ -63,13 +64,15 @@ public class JpaAction extends AbstractJpaTenantAwareBaseEntity implements Actio
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "target", foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_action_target"))
|
||||
@NotNull
|
||||
private JpaTarget target;
|
||||
|
||||
@Column(name = "active")
|
||||
private boolean active;
|
||||
|
||||
@Column(name = "action_type", nullable = false)
|
||||
@Column(name = "action_type", nullable = false, length = 16)
|
||||
@Enumerated(EnumType.STRING)
|
||||
@NotNull
|
||||
private ActionType actionType;
|
||||
|
||||
@Column(name = "forced_time")
|
||||
|
||||
@@ -25,6 +25,7 @@ import javax.persistence.NamedAttributeNode;
|
||||
import javax.persistence.NamedEntityGraph;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Transient;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import org.eclipse.hawkbit.repository.jpa.cache.CacheField;
|
||||
import org.eclipse.hawkbit.repository.jpa.cache.CacheKeys;
|
||||
@@ -54,9 +55,11 @@ public class JpaActionStatus extends AbstractJpaTenantAwareBaseEntity implements
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY, optional = false)
|
||||
@JoinColumn(name = "action", nullable = false, foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_act_stat_action"))
|
||||
@NotNull
|
||||
private JpaAction action;
|
||||
|
||||
@Column(name = "status")
|
||||
@NotNull
|
||||
private Status status;
|
||||
|
||||
@CascadeOnDelete
|
||||
|
||||
@@ -33,6 +33,7 @@ import javax.persistence.NamedEntityGraph;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.UniqueConstraint;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.AbstractPropertyChangeEvent.PropertyChange;
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.DistributionCreatedEvent;
|
||||
@@ -111,6 +112,7 @@ public class JpaDistributionSet extends AbstractJpaNamedVersionedEntity implemen
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY, targetEntity = JpaDistributionSetType.class)
|
||||
@JoinColumn(name = "ds_id", nullable = false, foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_ds_dstype_ds"))
|
||||
@NotNull
|
||||
private DistributionSetType type;
|
||||
|
||||
@Column(name = "complete")
|
||||
|
||||
@@ -22,6 +22,7 @@ import javax.persistence.JoinColumn;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.UniqueConstraint;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetType;
|
||||
@@ -50,9 +51,11 @@ public class JpaDistributionSetType extends AbstractJpaNamedEntity implements Di
|
||||
private final Set<DistributionSetTypeElement> elements = new HashSet<>();
|
||||
|
||||
@Column(name = "type_key", nullable = false, length = 64)
|
||||
@Size(max = 64)
|
||||
private String key;
|
||||
|
||||
@Column(name = "colour", nullable = true, length = 16)
|
||||
@Size(max = 16)
|
||||
private String colour;
|
||||
|
||||
@Column(name = "deleted")
|
||||
|
||||
@@ -20,6 +20,7 @@ import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.Table;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.ExternalArtifact;
|
||||
import org.eclipse.hawkbit.repository.model.ExternalArtifactProvider;
|
||||
@@ -44,6 +45,7 @@ public class JpaExternalArtifact extends AbstractJpaArtifact implements External
|
||||
private JpaExternalArtifactProvider externalArtifactProvider;
|
||||
|
||||
@Column(name = "url_suffix", length = 512)
|
||||
@Size(max = 512)
|
||||
private String urlSuffix;
|
||||
|
||||
// CascadeType.PERSIST as we register ourself at the BSM
|
||||
|
||||
@@ -12,6 +12,7 @@ import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Index;
|
||||
import javax.persistence.Table;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.ExternalArtifact;
|
||||
import org.eclipse.hawkbit.repository.model.ExternalArtifactProvider;
|
||||
@@ -30,9 +31,11 @@ public class JpaExternalArtifactProvider extends AbstractJpaNamedEntity implemen
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Column(name = "base_url", length = 512, nullable = false)
|
||||
@Size(max = 512)
|
||||
private String basePath;
|
||||
|
||||
@Column(name = "default_url_suffix", length = 512, nullable = true)
|
||||
@Size(max = 512)
|
||||
private String defaultSuffix;
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,6 +18,7 @@ import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.Table;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.LocalArtifact;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||
@@ -40,10 +41,12 @@ public class JpaLocalArtifact extends AbstractJpaArtifact implements LocalArtifa
|
||||
|
||||
@NotNull
|
||||
@Column(name = "gridfs_file_name", length = 40)
|
||||
@Size(max = 40)
|
||||
private String gridFsFileName;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "provided_file_name", length = 256)
|
||||
@Size(max = 256)
|
||||
private String filename;
|
||||
|
||||
@ManyToOne(optional = false, cascade = { CascadeType.PERSIST })
|
||||
|
||||
@@ -24,6 +24,8 @@ import javax.persistence.OneToMany;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Transient;
|
||||
import javax.persistence.UniqueConstraint;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.RolloutPropertyChangeEvent;
|
||||
import org.eclipse.hawkbit.repository.jpa.cache.CacheField;
|
||||
@@ -57,10 +59,13 @@ public class JpaRollout extends AbstractJpaNamedEntity implements Rollout, Event
|
||||
private List<RolloutGroup> rolloutGroups;
|
||||
|
||||
@Column(name = "target_filter", length = 1024, nullable = false)
|
||||
@Size(max = 1024)
|
||||
@NotNull
|
||||
private String targetFilterQuery;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "distribution_set", foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_rolltout_ds"))
|
||||
@NotNull
|
||||
private JpaDistributionSet distributionSet;
|
||||
|
||||
@Column(name = "status")
|
||||
@@ -69,8 +74,9 @@ public class JpaRollout extends AbstractJpaNamedEntity implements Rollout, Event
|
||||
@Column(name = "last_check")
|
||||
private long lastCheck;
|
||||
|
||||
@Column(name = "action_type", nullable = false)
|
||||
@Column(name = "action_type", nullable = false, length = 16)
|
||||
@Enumerated(EnumType.STRING)
|
||||
@NotNull
|
||||
private ActionType actionType = ActionType.FORCED;
|
||||
|
||||
@Column(name = "forced_time")
|
||||
|
||||
@@ -24,6 +24,7 @@ import javax.persistence.OneToMany;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Transient;
|
||||
import javax.persistence.UniqueConstraint;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.RolloutGroupPropertyChangeEvent;
|
||||
import org.eclipse.hawkbit.repository.jpa.model.helper.EntityPropertyChangeHelper;
|
||||
@@ -66,24 +67,28 @@ public class JpaRolloutGroup extends AbstractJpaNamedEntity implements RolloutGr
|
||||
private RolloutGroupSuccessCondition successCondition = RolloutGroupSuccessCondition.THRESHOLD;
|
||||
|
||||
@Column(name = "success_condition_exp", length = 512, nullable = false)
|
||||
@Size(max = 512)
|
||||
private String successConditionExp;
|
||||
|
||||
@Column(name = "success_action", nullable = false)
|
||||
private RolloutGroupSuccessAction successAction = RolloutGroupSuccessAction.NEXTGROUP;
|
||||
|
||||
@Column(name = "success_action_exp", length = 512, nullable = false)
|
||||
@Size(max = 512)
|
||||
private String successActionExp;
|
||||
|
||||
@Column(name = "error_condition")
|
||||
private RolloutGroupErrorCondition errorCondition;
|
||||
|
||||
@Column(name = "error_condition_exp", length = 512)
|
||||
@Size(max = 512)
|
||||
private String errorConditionExp;
|
||||
|
||||
@Column(name = "error_action")
|
||||
private RolloutGroupErrorAction errorAction;
|
||||
|
||||
@Column(name = "error_action_exp", length = 512)
|
||||
@Size(max = 512)
|
||||
private String errorActionExp;
|
||||
|
||||
@Column(name = "total_targets")
|
||||
|
||||
@@ -28,6 +28,8 @@ import javax.persistence.NamedEntityGraph;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.UniqueConstraint;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.Artifact;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||
@@ -58,6 +60,7 @@ public class JpaSoftwareModule extends AbstractJpaNamedVersionedEntity implement
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "module_type", nullable = false, foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_module_type"))
|
||||
@NotNull
|
||||
private JpaSoftwareModuleType type;
|
||||
|
||||
@ManyToMany(mappedBy = "modules", targetEntity = JpaDistributionSet.class, fetch = FetchType.LAZY)
|
||||
@@ -67,6 +70,7 @@ public class JpaSoftwareModule extends AbstractJpaNamedVersionedEntity implement
|
||||
private boolean deleted;
|
||||
|
||||
@Column(name = "vendor", nullable = true, length = 256)
|
||||
@Size(max = 256)
|
||||
private String vendor;
|
||||
|
||||
@OneToMany(mappedBy = "softwareModule", cascade = { CascadeType.ALL }, targetEntity = JpaLocalArtifact.class)
|
||||
|
||||
@@ -14,6 +14,8 @@ import javax.persistence.Index;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.UniqueConstraint;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModuleType;
|
||||
|
||||
@@ -34,6 +36,8 @@ public class JpaSoftwareModuleType extends AbstractJpaNamedEntity implements Sof
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Column(name = "type_key", nullable = false, length = 64)
|
||||
@Size(max = 64)
|
||||
@NotNull
|
||||
private String key;
|
||||
|
||||
@Column(name = "max_ds_assignments", nullable = false)
|
||||
@@ -41,6 +45,7 @@ public class JpaSoftwareModuleType extends AbstractJpaNamedEntity implements Sof
|
||||
private int maxAssignments;
|
||||
|
||||
@Column(name = "colour", nullable = true, length = 16)
|
||||
@Size(max = 16)
|
||||
private String colour;
|
||||
|
||||
@Column(name = "deleted")
|
||||
|
||||
@@ -74,7 +74,7 @@ public class JpaTarget extends AbstractJpaNamedEntity implements Persistable<Lon
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Column(name = "controller_id", length = 64)
|
||||
@Size(min = 1)
|
||||
@Size(min = 1, max = 64)
|
||||
@NotNull
|
||||
private String controllerId;
|
||||
|
||||
@@ -107,6 +107,8 @@ public class JpaTarget extends AbstractJpaNamedEntity implements Persistable<Lon
|
||||
* with this security token.
|
||||
*/
|
||||
@Column(name = "sec_token", insertable = true, updatable = true, nullable = false, length = 128)
|
||||
@Size(max = 64)
|
||||
@NotNull
|
||||
private String securityToken;
|
||||
|
||||
@CascadeOnDelete
|
||||
|
||||
@@ -13,6 +13,8 @@ import javax.persistence.Entity;
|
||||
import javax.persistence.Index;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.UniqueConstraint;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.TargetFilterQuery;
|
||||
|
||||
@@ -30,10 +32,14 @@ import org.eclipse.hawkbit.repository.model.TargetFilterQuery;
|
||||
public class JpaTargetFilterQuery extends AbstractJpaTenantAwareBaseEntity implements TargetFilterQuery {
|
||||
private static final long serialVersionUID = 7493966984413479089L;
|
||||
|
||||
@Column(name = "name", length = 64)
|
||||
@Column(name = "name", length = 64, nullable = false)
|
||||
@Size(max = 64)
|
||||
@NotNull
|
||||
private String name;
|
||||
|
||||
@Column(name = "query", length = 1024)
|
||||
@Column(name = "query", length = 1024, nullable = false)
|
||||
@Size(max = 1024)
|
||||
@NotNull
|
||||
private String query;
|
||||
|
||||
public JpaTargetFilterQuery() {
|
||||
|
||||
@@ -37,6 +37,8 @@ import javax.persistence.MapsId;
|
||||
import javax.persistence.OneToOne;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Transient;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import org.eclipse.hawkbit.repository.eventbus.event.TargetInfoUpdateEvent;
|
||||
import org.eclipse.hawkbit.repository.exception.InvalidTargetAddressException;
|
||||
@@ -88,6 +90,7 @@ public class JpaTargetInfo implements Persistable<Long>, TargetInfo, EventAwareE
|
||||
private JpaTarget target;
|
||||
|
||||
@Column(name = "address", length = 512)
|
||||
@Size(max = 512)
|
||||
private String address;
|
||||
|
||||
@Column(name = "last_target_query")
|
||||
@@ -96,8 +99,9 @@ public class JpaTargetInfo implements Persistable<Long>, TargetInfo, EventAwareE
|
||||
@Column(name = "install_date")
|
||||
private Long installationDate;
|
||||
|
||||
@Column(name = "update_status", nullable = false, length = 255)
|
||||
@Column(name = "update_status", nullable = false, length = 16)
|
||||
@Enumerated(EnumType.STRING)
|
||||
@NotNull
|
||||
private TargetUpdateStatus updateStatus = TargetUpdateStatus.UNKNOWN;
|
||||
|
||||
@ManyToOne(optional = true, fetch = FetchType.LAZY)
|
||||
|
||||
@@ -13,6 +13,8 @@ import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.UniqueConstraint;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.TenantConfiguration;
|
||||
|
||||
@@ -29,11 +31,15 @@ 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)
|
||||
@Column(name = "conf_key", length = 128, nullable = false)
|
||||
@Size(max = 128)
|
||||
@NotNull
|
||||
private String key;
|
||||
|
||||
@Column(name = "conf_value", length = 512)
|
||||
@Column(name = "conf_value", length = 512, nullable = false)
|
||||
@Basic
|
||||
@Size(max = 512)
|
||||
@NotNull
|
||||
private String value;
|
||||
|
||||
/**
|
||||
|
||||
@@ -19,6 +19,7 @@ import javax.persistence.JoinColumn;
|
||||
import javax.persistence.OneToOne;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.UniqueConstraint;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetType;
|
||||
import org.eclipse.hawkbit.repository.model.TenantAwareBaseEntity;
|
||||
@@ -43,6 +44,7 @@ public class JpaTenantMetaData extends AbstractJpaBaseEntity implements TenantMe
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Column(name = "tenant", nullable = false, length = 40)
|
||||
@Size(max = 40)
|
||||
private String tenant;
|
||||
|
||||
@OneToOne(fetch = FetchType.LAZY)
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
ALTER TABLE sp_target_info MODIFY update_status VARCHAR(16) not null;
|
||||
ALTER TABLE sp_action MODIFY action_type VARCHAR(16) not null;
|
||||
ALTER TABLE sp_rollout MODIFY action_type VARCHAR(16) not null;
|
||||
ALTER TABLE sp_tenant_configuration MODIFY conf_key VARCHAR(128) not null;
|
||||
ALTER TABLE sp_tenant_configuration MODIFY conf_value VARCHAR(512) not null;
|
||||
@@ -0,0 +1,5 @@
|
||||
ALTER TABLE sp_target_info MODIFY update_status VARCHAR(16) not null;
|
||||
ALTER TABLE sp_action MODIFY action_type VARCHAR(16) not null;
|
||||
ALTER TABLE sp_rollout MODIFY action_type VARCHAR(16) not null;
|
||||
ALTER TABLE sp_tenant_configuration MODIFY conf_key VARCHAR(128) not null;
|
||||
ALTER TABLE sp_tenant_configuration MODIFY conf_value VARCHAR(512) not null;
|
||||
@@ -506,6 +506,21 @@ public class TestdataFactory {
|
||||
return distributionSet;
|
||||
}
|
||||
|
||||
/**
|
||||
* builder method for generating a {@link DistributionSet}.
|
||||
*
|
||||
* @param name
|
||||
* {@link DistributionSet#getName()}
|
||||
*
|
||||
* @return the generated {@link DistributionSet}
|
||||
*/
|
||||
public DistributionSet generateDistributionSet(final String name) {
|
||||
final DistributionSet distributionSet = entityFactory.generateDistributionSet(name, DEFAULT_VERSION, null,
|
||||
findOrCreateDefaultTestDsType(), null);
|
||||
distributionSet.setDescription(LOREM.words(10));
|
||||
return distributionSet;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates {@link DistributionSetTag}s in repository.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user