X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=ves-agent%2Fsrc%2Fmain%2Fjava%2Forg%2Fcommscope%2Ftr069adapter%2Fvesagent%2Fentity%2FDeviceDataEntity.java;fp=ves-agent%2Fsrc%2Fmain%2Fjava%2Forg%2Fcommscope%2Ftr069adapter%2Fvesagent%2Fentity%2FDeviceDataEntity.java;h=63af6df87e7a09f29210157b702ffa5519a26aeb;hb=76744e810f35c84ecbd1d9998e361052466e9483;hp=07b50a78ed828d1b5200972effbd520c69da92a0;hpb=ce4e2d38e3d42725f61c39dd172325d2def4bc44;p=oam%2Ftr069-adapter.git diff --git a/ves-agent/src/main/java/org/commscope/tr069adapter/vesagent/entity/DeviceDataEntity.java b/ves-agent/src/main/java/org/commscope/tr069adapter/vesagent/entity/DeviceDataEntity.java index 07b50a7..63af6df 100644 --- a/ves-agent/src/main/java/org/commscope/tr069adapter/vesagent/entity/DeviceDataEntity.java +++ b/ves-agent/src/main/java/org/commscope/tr069adapter/vesagent/entity/DeviceDataEntity.java @@ -16,117 +16,117 @@ * ===============LICENSE_END======================================================================= */ -package org.commscope.tr069adapter.vesagent.entity; - -import com.google.gson.Gson; - -import java.util.Date; -import java.util.Map; - -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Table; -import javax.persistence.Transient; -import javax.persistence.UniqueConstraint; - -@Entity -@Table(name = "VES_DEVICE_DATA", - uniqueConstraints = @UniqueConstraint(columnNames = {"DEVICE_ID", "ATTR_GROUP"})) -public class DeviceDataEntity { - - @Id - @Column(name = "ID") - @GeneratedValue(strategy = GenerationType.AUTO) - private Long id; - - @Column(name = "DEVICE_ID", length = 30) - private String deviceId; - - @Column(name = "ENODEB_NAME", length = 100) - private String eNodeBName; - - @Column(name = "OUI", length = 30) - private String oui; - - @Column(name = "PRODUCT_CLASS", length = 100) - private String productClass; - - @Column(name = "ATTR_JSON", length = 4000) - private String attrJson; - - @Column(name = "ATTR_GROUP", length = 255) - private String attrGroup; - - @Column(name = "LAST_UPDATED_TIME") - private Date lastUpdateTime = new Date(); - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getDeviceId() { - return deviceId; - } - - public void setDeviceId(String deviceId) { - this.deviceId = deviceId; - } - - public String geteNodeBName() { - return eNodeBName; - } - - public void seteNodeBName(String eNodeBName) { - this.eNodeBName = eNodeBName; - } - - public String getOui() { - return oui; - } - - public void setOui(String oui) { - this.oui = oui; - } - - public String getProductClass() { - return productClass; - } - - public void setProductClass(String productClass) { - this.productClass = productClass; - } - - public String getAttrJson() { - return attrJson; - } - - public void setAttrJson(String attrJson) { - this.attrJson = attrJson; - } - - public String getAttrGroup() { - return attrGroup; - } - - public void setAttrGroup(String attrGroup) { - this.attrGroup = attrGroup; - } - - public Date getLastUpdateTime() { - return lastUpdateTime; - } - - public void setLastUpdateTime(Date lastUpdateTime) { - this.lastUpdateTime = lastUpdateTime; - } - +package org.commscope.tr069adapter.vesagent.entity; + +import com.google.gson.Gson; + +import java.util.Date; +import java.util.Map; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Transient; +import javax.persistence.UniqueConstraint; + +@Entity +@Table(name = "VES_DEVICE_DATA", + uniqueConstraints = @UniqueConstraint(columnNames = {"DEVICE_ID", "ATTR_GROUP"})) +public class DeviceDataEntity { + + @Id + @Column(name = "ID") + @GeneratedValue(strategy = GenerationType.AUTO) + private Long id; + + @Column(name = "DEVICE_ID", length = 30) + private String deviceId; + + @Column(name = "ENODEB_NAME", length = 100) + private String eNodeBName; + + @Column(name = "OUI", length = 30) + private String oui; + + @Column(name = "PRODUCT_CLASS", length = 100) + private String productClass; + + @Column(name = "ATTR_JSON", length = 4000) + private String attrJson; + + @Column(name = "ATTR_GROUP", length = 255) + private String attrGroup; + + @Column(name = "LAST_UPDATED_TIME") + private Date lastUpdateTime = new Date(); + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getDeviceId() { + return deviceId; + } + + public void setDeviceId(String deviceId) { + this.deviceId = deviceId; + } + + public String geteNodeBName() { + return eNodeBName; + } + + public void seteNodeBName(String eNodeBName) { + this.eNodeBName = eNodeBName; + } + + public String getOui() { + return oui; + } + + public void setOui(String oui) { + this.oui = oui; + } + + public String getProductClass() { + return productClass; + } + + public void setProductClass(String productClass) { + this.productClass = productClass; + } + + public String getAttrJson() { + return attrJson; + } + + public void setAttrJson(String attrJson) { + this.attrJson = attrJson; + } + + public String getAttrGroup() { + return attrGroup; + } + + public void setAttrGroup(String attrGroup) { + this.attrGroup = attrGroup; + } + + public Date getLastUpdateTime() { + return lastUpdateTime; + } + + public void setLastUpdateTime(Date lastUpdateTime) { + this.lastUpdateTime = lastUpdateTime; + } + @Transient private Long startEpochMicrosec; @@ -136,24 +136,24 @@ public class DeviceDataEntity { public void setStartEpochMicrosec(Long startEpochMicrosec) { this.startEpochMicrosec = startEpochMicrosec; - } - - @Transient - public void setAttributesMap(Map attributesMap) { - if (null == attributesMap || attributesMap.isEmpty()) { - return; - } - - this.attrJson = new Gson().toJson(attributesMap); - - } - - @Transient - public Map getAttributesMap() { - Map attributesMap = null; - if (null != this.attrJson && !this.attrJson.isEmpty()) { - attributesMap = new Gson().fromJson(this.attrJson, Map.class); - } - return attributesMap; - } -} + } + + @Transient + public void setAttributesMap(Map attributesMap) { + if (null == attributesMap || attributesMap.isEmpty()) { + return; + } + + this.attrJson = new Gson().toJson(attributesMap); + + } + + @Transient + public Map getAttributesMap() { + Map attributesMap = null; + if (null != this.attrJson && !this.attrJson.isEmpty()) { + attributesMap = new Gson().fromJson(this.attrJson, Map.class); + } + return attributesMap; + } +}