Showing
7 changed files
with
27 additions
and
18 deletions
@@ -17,15 +17,15 @@ | @@ -17,15 +17,15 @@ | ||
17 | DROP TABLE IF EXISTS entity_views; | 17 | DROP TABLE IF EXISTS entity_views; |
18 | 18 | ||
19 | CREATE TABLE IF NOT EXISTS entity_views ( | 19 | CREATE TABLE IF NOT EXISTS entity_views ( |
20 | - id varchar(31) NOT NULL CONSTRAINT entity_views_pkey PRIMARY KEY, | ||
21 | - additional_info varchar, | 20 | + id varchar(31) NOT NULL CONSTRAINT entity_view_pkey PRIMARY KEY, |
21 | + entity_id varchar(31), | ||
22 | + entity_type varchar(255), | ||
23 | + tenant_id varchar(31), | ||
22 | customer_id varchar(31), | 24 | customer_id varchar(31), |
25 | + name varchar(255), | ||
23 | keys varchar(255), | 26 | keys varchar(255), |
24 | ts_begin varchar(255), | 27 | ts_begin varchar(255), |
25 | ts_end varchar(255), | 28 | ts_end varchar(255), |
26 | - name varchar(255), | ||
27 | search_text varchar(255), | 29 | search_text varchar(255), |
28 | - entity_id varchar(31), | ||
29 | - entity_type varchar(255), | ||
30 | - tenant_id varchar(31) | 30 | + additional_info varchar |
31 | ); | 31 | ); |
@@ -38,7 +38,7 @@ public class EntityView extends SearchTextBasedWithAdditionalInfo<EntityViewId> | @@ -38,7 +38,7 @@ public class EntityView extends SearchTextBasedWithAdditionalInfo<EntityViewId> | ||
38 | private TenantId tenantId; | 38 | private TenantId tenantId; |
39 | private CustomerId customerId; | 39 | private CustomerId customerId; |
40 | private String name; | 40 | private String name; |
41 | - private TelemetryEntityView keys; //To Do: Changed from all code | 41 | + private TelemetryEntityView keys; |
42 | private Long tsBegin; | 42 | private Long tsBegin; |
43 | private Long tsEnd; | 43 | private Long tsEnd; |
44 | 44 |
@@ -44,4 +44,9 @@ public class AttributesEntityView { | @@ -44,4 +44,9 @@ public class AttributesEntityView { | ||
44 | public AttributesEntityView(AttributesEntityView obj) { | 44 | public AttributesEntityView(AttributesEntityView obj) { |
45 | this(obj.getCs(), obj.getSs(), obj.getSh()); | 45 | this(obj.getCs(), obj.getSs(), obj.getSh()); |
46 | } | 46 | } |
47 | + | ||
48 | + @Override | ||
49 | + public String toString() { | ||
50 | + return "{cs=" + cs + ", ss=" + ss + ", sh=" + sh + '}'; | ||
51 | + } | ||
47 | } | 52 | } |
@@ -40,4 +40,9 @@ public class TelemetryEntityView { | @@ -40,4 +40,9 @@ public class TelemetryEntityView { | ||
40 | public TelemetryEntityView(TelemetryEntityView obj) { | 40 | public TelemetryEntityView(TelemetryEntityView obj) { |
41 | this(obj.getTimeseries(), obj.getAttributes()); | 41 | this(obj.getTimeseries(), obj.getAttributes()); |
42 | } | 42 | } |
43 | + | ||
44 | + @Override | ||
45 | + public String toString() { | ||
46 | + return "{timeseries=" + timeseries + ", attributes=" + attributes + '}'; | ||
47 | + } | ||
43 | } | 48 | } |
@@ -213,7 +213,7 @@ public class EntityViewServiceImpl extends AbstractEntityService | @@ -213,7 +213,7 @@ public class EntityViewServiceImpl extends AbstractEntityService | ||
213 | 213 | ||
214 | @Override | 214 | @Override |
215 | protected void validateDataImpl(EntityView entityView) { | 215 | protected void validateDataImpl(EntityView entityView) { |
216 | - if (StringUtils.isEmpty(String.join("", entityView.getKeys()))) { | 216 | + if (StringUtils.isEmpty(entityView.getKeys().toString())) { |
217 | throw new DataValidationException("Entity view type should be specified!"); | 217 | throw new DataValidationException("Entity view type should be specified!"); |
218 | } | 218 | } |
219 | if (StringUtils.isEmpty(entityView.getName())) { | 219 | if (StringUtils.isEmpty(entityView.getName())) { |
@@ -272,6 +272,5 @@ public class EntityViewServiceImpl extends AbstractEntityService | @@ -272,6 +272,5 @@ public class EntityViewServiceImpl extends AbstractEntityService | ||
272 | protected void removeEntity(EntityView entity) { | 272 | protected void removeEntity(EntityView entity) { |
273 | unassignEntityViewFromCustomer(new EntityViewId(entity.getUuidId())); | 273 | unassignEntityViewFromCustomer(new EntityViewId(entity.getUuidId())); |
274 | } | 274 | } |
275 | - | ||
276 | } | 275 | } |
277 | } | 276 | } |
@@ -51,6 +51,10 @@ public class EntityViewEntity extends BaseSqlEntity<EntityView> implements Searc | @@ -51,6 +51,10 @@ public class EntityViewEntity extends BaseSqlEntity<EntityView> implements Searc | ||
51 | @Column(name = ModelConstants.ENTITY_VIEW_ENTITY_ID_PROPERTY) | 51 | @Column(name = ModelConstants.ENTITY_VIEW_ENTITY_ID_PROPERTY) |
52 | private String entityId; | 52 | private String entityId; |
53 | 53 | ||
54 | + @Enumerated(EnumType.STRING) | ||
55 | + @Column(name = ENTITY_TYPE_PROPERTY) | ||
56 | + private EntityType entityType; | ||
57 | + | ||
54 | @Column(name = ModelConstants.ENTITY_VIEW_TENANT_ID_PROPERTY) | 58 | @Column(name = ModelConstants.ENTITY_VIEW_TENANT_ID_PROPERTY) |
55 | private String tenantId; | 59 | private String tenantId; |
56 | 60 | ||
@@ -60,10 +64,6 @@ public class EntityViewEntity extends BaseSqlEntity<EntityView> implements Searc | @@ -60,10 +64,6 @@ public class EntityViewEntity extends BaseSqlEntity<EntityView> implements Searc | ||
60 | @Column(name = ModelConstants.ENTITY_VIEW_NAME_PROPERTY) | 64 | @Column(name = ModelConstants.ENTITY_VIEW_NAME_PROPERTY) |
61 | private String name; | 65 | private String name; |
62 | 66 | ||
63 | - @Enumerated(EnumType.STRING) | ||
64 | - @Column(name = ENTITY_TYPE_PROPERTY) | ||
65 | - private EntityType entityType; | ||
66 | - | ||
67 | @Column(name = ModelConstants.ENTITY_VIEW_KEYS_PROPERTY) | 67 | @Column(name = ModelConstants.ENTITY_VIEW_KEYS_PROPERTY) |
68 | private String keys; | 68 | private String keys; |
69 | 69 |
@@ -254,14 +254,14 @@ CREATE TABLE IF NOT EXISTS rule_node ( | @@ -254,14 +254,14 @@ CREATE TABLE IF NOT EXISTS rule_node ( | ||
254 | 254 | ||
255 | CREATE TABLE IF NOT EXISTS entity_views ( | 255 | CREATE TABLE IF NOT EXISTS entity_views ( |
256 | id varchar(31) NOT NULL CONSTRAINT entity_view_pkey PRIMARY KEY, | 256 | id varchar(31) NOT NULL CONSTRAINT entity_view_pkey PRIMARY KEY, |
257 | - additional_info varchar, | 257 | + entity_id varchar(31), |
258 | + entity_type varchar(255), | ||
259 | + tenant_id varchar(31), | ||
258 | customer_id varchar(31), | 260 | customer_id varchar(31), |
261 | + name varchar(255), | ||
259 | keys varchar(255), | 262 | keys varchar(255), |
260 | ts_begin varchar(255), | 263 | ts_begin varchar(255), |
261 | ts_end varchar(255), | 264 | ts_end varchar(255), |
262 | - name varchar(255), | ||
263 | - entity_type varchar(255), | ||
264 | search_text varchar(255), | 265 | search_text varchar(255), |
265 | - entity_id varchar(31), | ||
266 | - tenant_id varchar(31) | 266 | + additional_info varchar |
267 | ); | 267 | ); |