Commit ad48ecabd84f961ebaeefe385d94966077d9a1c4
1 parent
84224067
Was added some of the entity-view constants and refactored code
Showing
3 changed files
with
10 additions
and
11 deletions
... | ... | @@ -136,7 +136,6 @@ public class ModelConstants { |
136 | 136 | public static final String DEVICE_NAME_PROPERTY = "name"; |
137 | 137 | public static final String DEVICE_TYPE_PROPERTY = "type"; |
138 | 138 | public static final String DEVICE_ADDITIONAL_INFO_PROPERTY = ADDITIONAL_INFO_PROPERTY; |
139 | - | |
140 | 139 | public static final String DEVICE_BY_TENANT_AND_SEARCH_TEXT_COLUMN_FAMILY_NAME = "device_by_tenant_and_search_text"; |
141 | 140 | public static final String DEVICE_BY_TENANT_BY_TYPE_AND_SEARCH_TEXT_COLUMN_FAMILY_NAME = "device_by_tenant_by_type_and_search_text"; |
142 | 141 | public static final String DEVICE_BY_CUSTOMER_AND_SEARCH_TEXT_COLUMN_FAMILY_NAME = "device_by_customer_and_search_text"; |
... | ... | @@ -152,11 +151,12 @@ public class ModelConstants { |
152 | 151 | public static final String ENTITY_VIEW_TENANT_ID_PROPERTY = TENANT_ID_PROPERTY; |
153 | 152 | public static final String ENTITY_VIEW_CUSTOMER_ID_PROPERTY = CUSTOMER_ID_PROPERTY; |
154 | 153 | public static final String ENTITY_VIEW_NAME_PROPERTY = DEVICE_NAME_PROPERTY; |
155 | - public static final String ENTITY_VIEW_TYPE_PROPERTY = "type_entity"; | |
154 | + public static final String ENTITY_VIEW_TENANT_AND_NAME_VIEW_NAME = "entity_view_by_tenant_and_name"; | |
156 | 155 | public static final String ENTITY_VIEW_KEYS_PROPERTY = "keys"; |
157 | 156 | public static final String ENTITY_VIEW_TS_BEGIN_PROPERTY = "ts_begin"; |
158 | 157 | public static final String ENTITY_VIEW_TS_END_PROPERTY = "ts_end"; |
159 | 158 | public static final String ENTITY_VIEW_ADDITIONAL_INFO_PROPERTY = ADDITIONAL_INFO_PROPERTY; |
159 | + public static final String ENTITY_VIEW_BY_TENANT_AND_SEARCH_TEXT_COLUMN_FAMILY_NAME = "entity_view_by_tenant_and_search_text"; | |
160 | 160 | |
161 | 161 | /** |
162 | 162 | * Cassandra audit log constants. | ... | ... |
... | ... | @@ -116,8 +116,8 @@ public class EntityViewEntity implements SearchTextEntity<EntityView> { |
116 | 116 | } catch (IOException e) { |
117 | 117 | e.printStackTrace(); |
118 | 118 | } |
119 | - this.tsBegin = entityView.getTsBegin() != null ? String.valueOf(entityView.getTsBegin()) : "0"; | |
120 | - this.tsEnd = entityView.getTsEnd() != null ? String.valueOf(entityView.getTsEnd()) : "0"; | |
119 | + this.tsBegin = entityView.getStartTs() != null ? String.valueOf(entityView.getStartTs()) : "0"; | |
120 | + this.tsEnd = entityView.getEndTs() != null ? String.valueOf(entityView.getEndTs()) : "0"; | |
121 | 121 | this.searchText = entityView.getSearchText(); |
122 | 122 | this.additionalInfo = entityView.getAdditionalInfo(); |
123 | 123 | } |
... | ... | @@ -146,8 +146,8 @@ public class EntityViewEntity implements SearchTextEntity<EntityView> { |
146 | 146 | } catch (IOException e) { |
147 | 147 | e.printStackTrace(); |
148 | 148 | } |
149 | - entityView.setTsBegin(Long.parseLong(tsBegin)); | |
150 | - entityView.setTsEnd(Long.parseLong(tsEnd)); | |
149 | + entityView.setStartTs(Long.parseLong(tsBegin)); | |
150 | + entityView.setEndTs(Long.parseLong(tsEnd)); | |
151 | 151 | entityView.setAdditionalInfo(additionalInfo); |
152 | 152 | return entityView; |
153 | 153 | } | ... | ... |
... | ... | @@ -34,7 +34,6 @@ import org.thingsboard.server.dao.util.mapping.JsonStringType; |
34 | 34 | import javax.persistence.*; |
35 | 35 | import java.io.IOException; |
36 | 36 | |
37 | -import static org.thingsboard.server.dao.model.ModelConstants.AUDIT_LOG_ENTITY_TYPE_PROPERTY; | |
38 | 37 | import static org.thingsboard.server.dao.model.ModelConstants.ENTITY_TYPE_PROPERTY; |
39 | 38 | |
40 | 39 | /** |
... | ... | @@ -106,8 +105,8 @@ public class EntityViewEntity extends BaseSqlEntity<EntityView> implements Searc |
106 | 105 | } catch (IOException e) { |
107 | 106 | e.printStackTrace(); |
108 | 107 | } |
109 | - this.tsBegin = entityView.getTsBegin() != null ? String.valueOf(entityView.getTsBegin()) : "0"; | |
110 | - this.tsEnd = entityView.getTsEnd() != null ? String.valueOf(entityView.getTsEnd()) : "0"; | |
108 | + this.tsBegin = entityView.getStartTs() != null ? String.valueOf(entityView.getStartTs()) : "0"; | |
109 | + this.tsEnd = entityView.getEndTs() != null ? String.valueOf(entityView.getEndTs()) : "0"; | |
111 | 110 | this.searchText = entityView.getSearchText(); |
112 | 111 | this.additionalInfo = entityView.getAdditionalInfo(); |
113 | 112 | } |
... | ... | @@ -142,8 +141,8 @@ public class EntityViewEntity extends BaseSqlEntity<EntityView> implements Searc |
142 | 141 | } catch (IOException e) { |
143 | 142 | e.printStackTrace(); |
144 | 143 | } |
145 | - entityView.setTsBegin(Long.parseLong(tsBegin)); | |
146 | - entityView.setTsEnd(Long.parseLong(tsEnd)); | |
144 | + entityView.setStartTs(Long.parseLong(tsBegin)); | |
145 | + entityView.setEndTs(Long.parseLong(tsEnd)); | |
147 | 146 | entityView.setAdditionalInfo(additionalInfo); |
148 | 147 | return entityView; |
149 | 148 | } | ... | ... |