解决了出行动态中道路事件重复存储的问题
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
package com.mogo.module.common.constants;
|
||||
|
||||
/**
|
||||
* 数据库常量
|
||||
*/
|
||||
public class RoomConstants {
|
||||
public static final String DB_NAME_V2X = "MoGoScenario.db";
|
||||
public static final String TB_NAME_SCENARIO = "tb_travel_scenario";
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.mogo.module.common.entity;
|
||||
|
||||
import com.mogo.map.location.MogoLocation;
|
||||
import com.mogo.module.common.constants.RoomConstants;
|
||||
import com.mogo.utils.sqlite.annotation.DbDatabase;
|
||||
import com.mogo.utils.sqlite.annotation.DbField;
|
||||
import com.mogo.utils.sqlite.annotation.DbTable;
|
||||
@@ -10,8 +10,8 @@ import com.mogo.utils.sqlite.annotation.DbTable;
|
||||
*
|
||||
* @author donghongyu
|
||||
*/
|
||||
@DbDatabase(dbName = "MoGoScenario.db")
|
||||
@DbTable(tableName = "tb_history_scenario")
|
||||
@DbDatabase(dbName = RoomConstants.DB_NAME_V2X)
|
||||
@DbTable(tableName = RoomConstants.TB_NAME_SCENARIO)
|
||||
public class V2XHistoryScenarioData {
|
||||
|
||||
/**
|
||||
@@ -32,6 +32,13 @@ public class V2XHistoryScenarioData {
|
||||
@DbField(fieldName = "eventJsonData")
|
||||
public String eventJsonData;
|
||||
|
||||
/**
|
||||
* 事件json HashCode
|
||||
* 只取json中的几个代表性字段,表示唯一性,因为图片地址会经常被改变
|
||||
*/
|
||||
@DbField(fieldName = "eventJsonDataHashCode")
|
||||
public Integer eventJsonDataHashCode;
|
||||
|
||||
/**
|
||||
* 事件是否被处理过了,true-处理过了。false-未处理过
|
||||
*/
|
||||
@@ -70,8 +77,16 @@ public class V2XHistoryScenarioData {
|
||||
isDispose = dispose;
|
||||
}
|
||||
|
||||
public Integer getEventJsonDataHashCode() {
|
||||
return eventJsonDataHashCode;
|
||||
}
|
||||
|
||||
public void setEventJsonDataHashCode(Integer eventJsonDataHashCode) {
|
||||
this.eventJsonDataHashCode = eventJsonDataHashCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public V2XHistoryScenarioData clone() throws CloneNotSupportedException {
|
||||
public V2XHistoryScenarioData clone() {
|
||||
try {
|
||||
return (V2XHistoryScenarioData) super.clone();
|
||||
} catch (CloneNotSupportedException e) {
|
||||
|
||||
Reference in New Issue
Block a user