Commit 2f89b6d0f3919504bc906ba32f6ce6e6b3a9839d

Authored by Igor Kulikov
1 parent 10bbeef6

Fix RuleChain DAO model

... ... @@ -68,7 +68,7 @@ CREATE TABLE IF NOT EXISTS thingsboard.rule_chain (
68 68 name text,
69 69 search_text text,
70 70 first_rule_node_id uuid,
71   - is_root boolean,
  71 + root boolean,
72 72 configuration text,
73 73 additional_info text,
74 74 PRIMARY KEY (id, tenant_id)
... ...
... ... @@ -20,7 +20,7 @@ CREATE TABLE IF NOT EXISTS rule_chain (
20 20 configuration varchar(10000000),
21 21 name varchar(255),
22 22 first_rule_node_id varchar(31),
23   - is_root boolean,
  23 + root boolean,
24 24 search_text varchar(255),
25 25 tenant_id varchar(31)
26 26 );
... ...
... ... @@ -36,7 +36,7 @@ public class RuleChain extends SearchTextBasedWithAdditionalInfo<RuleChainId> im
36 36 private TenantId tenantId;
37 37 private String name;
38 38 private RuleNodeId firstRuleNodeId;
39   - private boolean isRoot;
  39 + private boolean root;
40 40 private transient JsonNode configuration;
41 41 @JsonIgnore
42 42 private byte[] configurationBytes;
... ... @@ -54,7 +54,7 @@ public class RuleChain extends SearchTextBasedWithAdditionalInfo<RuleChainId> im
54 54 this.tenantId = ruleChain.getTenantId();
55 55 this.name = ruleChain.getName();
56 56 this.firstRuleNodeId = ruleChain.getFirstRuleNodeId();
57   - this.isRoot = ruleChain.isRoot();
  57 + this.root = ruleChain.isRoot();
58 58 this.setConfiguration(ruleChain.getConfiguration());
59 59 }
60 60
... ...
... ... @@ -339,7 +339,7 @@ public class ModelConstants {
339 339 public static final String RULE_CHAIN_TENANT_ID_PROPERTY = TENANT_ID_PROPERTY;
340 340 public static final String RULE_CHAIN_NAME_PROPERTY = "name";
341 341 public static final String RULE_CHAIN_FIRST_RULE_NODE_ID_PROPERTY = "first_rule_node_id";
342   - public static final String RULE_CHAIN_IS_ROOT_PROPERTY = "is_root";
  342 + public static final String RULE_CHAIN_ROOT_PROPERTY = "root";
343 343 public static final String RULE_CHAIN_CONFIGURATION_PROPERTY = "configuration";
344 344
345 345 public static final String RULE_CHAIN_BY_TENANT_AND_SEARCH_TEXT_COLUMN_FAMILY_NAME = "rule_chain_by_tenant_and_search_text";
... ...
... ... @@ -52,8 +52,8 @@ public class RuleChainEntity implements SearchTextEntity<RuleChain> {
52 52 private String searchText;
53 53 @Column(name = RULE_CHAIN_FIRST_RULE_NODE_ID_PROPERTY)
54 54 private UUID firstRuleNodeId;
55   - @Column(name = RULE_CHAIN_IS_ROOT_PROPERTY)
56   - private boolean isRoot;
  55 + @Column(name = RULE_CHAIN_ROOT_PROPERTY)
  56 + private boolean root;
57 57 @Column(name = RULE_CHAIN_CONFIGURATION_PROPERTY, codec = JsonCodec.class)
58 58 private JsonNode configuration;
59 59 @Column(name = ADDITIONAL_INFO_PROPERTY, codec = JsonCodec.class)
... ... @@ -70,7 +70,7 @@ public class RuleChainEntity implements SearchTextEntity<RuleChain> {
70 70 this.name = ruleChain.getName();
71 71 this.searchText = ruleChain.getName();
72 72 this.firstRuleNodeId = DaoUtil.getId(ruleChain.getFirstRuleNodeId());
73   - this.isRoot = ruleChain.isRoot();
  73 + this.root = ruleChain.isRoot();
74 74 this.configuration = ruleChain.getConfiguration();
75 75 this.additionalInfo = ruleChain.getAdditionalInfo();
76 76 }
... ... @@ -120,11 +120,11 @@ public class RuleChainEntity implements SearchTextEntity<RuleChain> {
120 120 }
121 121
122 122 public boolean isRoot() {
123   - return isRoot;
  123 + return root;
124 124 }
125 125
126   - public void setRoot(boolean isRoot) {
127   - this.isRoot = isRoot;
  126 + public void setRoot(boolean root) {
  127 + this.root = root;
128 128 }
129 129
130 130 public String getSearchText() {
... ... @@ -156,7 +156,7 @@ public class RuleChainEntity implements SearchTextEntity<RuleChain> {
156 156 if (this.firstRuleNodeId != null) {
157 157 ruleChain.setFirstRuleNodeId(new RuleNodeId(this.firstRuleNodeId));
158 158 }
159   - ruleChain.setRoot(this.isRoot);
  159 + ruleChain.setRoot(this.root);
160 160 ruleChain.setConfiguration(this.configuration);
161 161 ruleChain.setAdditionalInfo(this.additionalInfo);
162 162 return ruleChain;
... ...
... ... @@ -55,8 +55,8 @@ public class RuleChainEntity extends BaseSqlEntity<RuleChain> implements SearchT
55 55 @Column(name = ModelConstants.RULE_CHAIN_FIRST_RULE_NODE_ID_PROPERTY)
56 56 private String firstRuleNodeId;
57 57
58   - @Column(name = ModelConstants.RULE_CHAIN_IS_ROOT_PROPERTY)
59   - private boolean isRoot;
  58 + @Column(name = ModelConstants.RULE_CHAIN_ROOT_PROPERTY)
  59 + private boolean root;
60 60
61 61 @Type(type = "json")
62 62 @Column(name = ModelConstants.RULE_CHAIN_CONFIGURATION_PROPERTY)
... ... @@ -79,7 +79,7 @@ public class RuleChainEntity extends BaseSqlEntity<RuleChain> implements SearchT
79 79 if (ruleChain.getFirstRuleNodeId() != null) {
80 80 this.firstRuleNodeId = UUIDConverter.fromTimeUUID(ruleChain.getFirstRuleNodeId().getId());
81 81 }
82   - this.isRoot = ruleChain.isRoot();
  82 + this.root = ruleChain.isRoot();
83 83 this.configuration = ruleChain.getConfiguration();
84 84 this.additionalInfo = ruleChain.getAdditionalInfo();
85 85 }
... ... @@ -103,7 +103,7 @@ public class RuleChainEntity extends BaseSqlEntity<RuleChain> implements SearchT
103 103 if (firstRuleNodeId != null) {
104 104 ruleChain.setFirstRuleNodeId(new RuleNodeId(UUIDConverter.fromString(firstRuleNodeId)));
105 105 }
106   - ruleChain.setRoot(isRoot);
  106 + ruleChain.setRoot(root);
107 107 ruleChain.setConfiguration(configuration);
108 108 ruleChain.setAdditionalInfo(additionalInfo);
109 109 return ruleChain;
... ...
... ... @@ -668,7 +668,7 @@ CREATE TABLE IF NOT EXISTS thingsboard.rule_chain (
668 668 name text,
669 669 search_text text,
670 670 first_rule_node_id uuid,
671   - is_root boolean,
  671 + root boolean,
672 672 configuration text,
673 673 additional_info text,
674 674 PRIMARY KEY (id, tenant_id)
... ...
... ... @@ -262,7 +262,7 @@ CREATE TABLE IF NOT EXISTS rule_chain (
262 262 configuration varchar(10000000),
263 263 name varchar(255),
264 264 first_rule_node_id varchar(31),
265   - is_root boolean,
  265 + root boolean,
266 266 search_text varchar(255),
267 267 tenant_id varchar(31)
268 268 );
... ...