From 6fe13db22d7fc6f0d9f5e24499f34de1f665cc2d Mon Sep 17 00:00:00 2001 From: snoop Date: Fri, 9 Jun 2017 14:32:24 +0900 Subject: [PATCH] added Sensor series --- .../overflow/sensor/dao/JPASensorDao.java | 10 ++ .../sensor/dao/JPASensorItemCategoryDao.java | 10 ++ .../overflow/sensor/dao/JPASensorItemDao.java | 10 ++ .../sensor/dao/JPASensorItemMappingDao.java | 10 ++ .../loafle/overflow/sensor/dao/SensorDao.java | 10 ++ .../sensor/dao/SensorItemCategoryDao.java | 10 ++ .../overflow/sensor/dao/SensorItemDao.java | 10 ++ .../sensor/dao/SensorItemMappingDao.java | 10 ++ .../loafle/overflow/sensor/model/Sensor.java | 83 ++++++++++++++++ .../overflow/sensor/model/SensorItem.java | 94 +++++++++++++++++++ .../sensor/model/SensorItemCategory.java | 56 +++++++++++ .../sensor/model/SensorItemMapping.java | 58 ++++++++++++ 12 files changed, 371 insertions(+) create mode 100644 src/main/java/com/loafle/overflow/sensor/dao/JPASensorDao.java create mode 100644 src/main/java/com/loafle/overflow/sensor/dao/JPASensorItemCategoryDao.java create mode 100644 src/main/java/com/loafle/overflow/sensor/dao/JPASensorItemDao.java create mode 100644 src/main/java/com/loafle/overflow/sensor/dao/JPASensorItemMappingDao.java create mode 100644 src/main/java/com/loafle/overflow/sensor/dao/SensorDao.java create mode 100644 src/main/java/com/loafle/overflow/sensor/dao/SensorItemCategoryDao.java create mode 100644 src/main/java/com/loafle/overflow/sensor/dao/SensorItemDao.java create mode 100644 src/main/java/com/loafle/overflow/sensor/dao/SensorItemMappingDao.java create mode 100644 src/main/java/com/loafle/overflow/sensor/model/Sensor.java create mode 100644 src/main/java/com/loafle/overflow/sensor/model/SensorItem.java create mode 100644 src/main/java/com/loafle/overflow/sensor/model/SensorItemCategory.java create mode 100644 src/main/java/com/loafle/overflow/sensor/model/SensorItemMapping.java diff --git a/src/main/java/com/loafle/overflow/sensor/dao/JPASensorDao.java b/src/main/java/com/loafle/overflow/sensor/dao/JPASensorDao.java new file mode 100644 index 0000000..6321dc0 --- /dev/null +++ b/src/main/java/com/loafle/overflow/sensor/dao/JPASensorDao.java @@ -0,0 +1,10 @@ +package com.loafle.overflow.sensor.dao; + +import com.loafle.overflow.commons.dao.JPABaseDAO; +import com.loafle.overflow.sensor.model.Sensor; + +/** + * Created by root on 17. 6. 9. + */ +public class JPASensorDao extends JPABaseDAO implements SensorDao { +} diff --git a/src/main/java/com/loafle/overflow/sensor/dao/JPASensorItemCategoryDao.java b/src/main/java/com/loafle/overflow/sensor/dao/JPASensorItemCategoryDao.java new file mode 100644 index 0000000..85d071a --- /dev/null +++ b/src/main/java/com/loafle/overflow/sensor/dao/JPASensorItemCategoryDao.java @@ -0,0 +1,10 @@ +package com.loafle.overflow.sensor.dao; + +import com.loafle.overflow.commons.dao.JPABaseDAO; +import com.loafle.overflow.sensor.model.SensorItemCategory; + +/** + * Created by root on 17. 6. 9. + */ +public class JPASensorItemCategoryDao extends JPABaseDAO implements SensorItemCategoryDao { +} diff --git a/src/main/java/com/loafle/overflow/sensor/dao/JPASensorItemDao.java b/src/main/java/com/loafle/overflow/sensor/dao/JPASensorItemDao.java new file mode 100644 index 0000000..4985882 --- /dev/null +++ b/src/main/java/com/loafle/overflow/sensor/dao/JPASensorItemDao.java @@ -0,0 +1,10 @@ +package com.loafle.overflow.sensor.dao; + +import com.loafle.overflow.commons.dao.JPABaseDAO; +import com.loafle.overflow.sensor.model.SensorItem; + +/** + * Created by root on 17. 6. 9. + */ +public class JPASensorItemDao extends JPABaseDAO implements SensorItemDao { +} diff --git a/src/main/java/com/loafle/overflow/sensor/dao/JPASensorItemMappingDao.java b/src/main/java/com/loafle/overflow/sensor/dao/JPASensorItemMappingDao.java new file mode 100644 index 0000000..c410a39 --- /dev/null +++ b/src/main/java/com/loafle/overflow/sensor/dao/JPASensorItemMappingDao.java @@ -0,0 +1,10 @@ +package com.loafle.overflow.sensor.dao; + +import com.loafle.overflow.commons.dao.JPABaseDAO; +import com.loafle.overflow.sensor.model.SensorItemMapping; + +/** + * Created by root on 17. 6. 9. + */ +public class JPASensorItemMappingDao extends JPABaseDAO implements SensorItemMappingDao { +} diff --git a/src/main/java/com/loafle/overflow/sensor/dao/SensorDao.java b/src/main/java/com/loafle/overflow/sensor/dao/SensorDao.java new file mode 100644 index 0000000..9bd3105 --- /dev/null +++ b/src/main/java/com/loafle/overflow/sensor/dao/SensorDao.java @@ -0,0 +1,10 @@ +package com.loafle.overflow.sensor.dao; + +import com.loafle.overflow.commons.dao.BaseDAO; +import com.loafle.overflow.sensor.model.Sensor; + +/** + * Created by root on 17. 6. 9. + */ +public interface SensorDao extends BaseDAO { +} diff --git a/src/main/java/com/loafle/overflow/sensor/dao/SensorItemCategoryDao.java b/src/main/java/com/loafle/overflow/sensor/dao/SensorItemCategoryDao.java new file mode 100644 index 0000000..d6e2270 --- /dev/null +++ b/src/main/java/com/loafle/overflow/sensor/dao/SensorItemCategoryDao.java @@ -0,0 +1,10 @@ +package com.loafle.overflow.sensor.dao; + +import com.loafle.overflow.commons.dao.BaseDAO; +import com.loafle.overflow.sensor.model.SensorItemCategory; + +/** + * Created by root on 17. 6. 9. + */ +public interface SensorItemCategoryDao extends BaseDAO { +} diff --git a/src/main/java/com/loafle/overflow/sensor/dao/SensorItemDao.java b/src/main/java/com/loafle/overflow/sensor/dao/SensorItemDao.java new file mode 100644 index 0000000..f0d6070 --- /dev/null +++ b/src/main/java/com/loafle/overflow/sensor/dao/SensorItemDao.java @@ -0,0 +1,10 @@ +package com.loafle.overflow.sensor.dao; + +import com.loafle.overflow.commons.dao.BaseDAO; +import com.loafle.overflow.sensor.model.SensorItem; + +/** + * Created by root on 17. 6. 9. + */ +public interface SensorItemDao extends BaseDAO{ +} diff --git a/src/main/java/com/loafle/overflow/sensor/dao/SensorItemMappingDao.java b/src/main/java/com/loafle/overflow/sensor/dao/SensorItemMappingDao.java new file mode 100644 index 0000000..c7cb238 --- /dev/null +++ b/src/main/java/com/loafle/overflow/sensor/dao/SensorItemMappingDao.java @@ -0,0 +1,10 @@ +package com.loafle.overflow.sensor.dao; + +import com.loafle.overflow.commons.dao.BaseDAO; +import com.loafle.overflow.sensor.model.SensorItemMapping; + +/** + * Created by root on 17. 6. 9. + */ +public interface SensorItemMappingDao extends BaseDAO { +} diff --git a/src/main/java/com/loafle/overflow/sensor/model/Sensor.java b/src/main/java/com/loafle/overflow/sensor/model/Sensor.java new file mode 100644 index 0000000..bc73955 --- /dev/null +++ b/src/main/java/com/loafle/overflow/sensor/model/Sensor.java @@ -0,0 +1,83 @@ +package com.loafle.overflow.sensor.model; + +import com.loafle.overflow.crawler.model.Crawler; +import com.loafle.overflow.target.model.Target; + +import javax.persistence.*; +import java.util.Date; + +/** + * Created by root on 17. 6. 9. + */ +@Entity +public class Sensor { + + @Id + @GeneratedValue(strategy= GenerationType.IDENTITY) + private Long id; + + @Column(name = "INTERVAL") + private long interval; + + @Column(name = "NOTIFICATION") + private String notification; + + @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = true) + private Date createDate; + + @ManyToOne + @Column(name = "TARGET_ID", nullable = false) + private Target target; + + @ManyToOne + @Column(name = "CRAWLER_ID", nullable = false) + private Crawler crawler; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public long getInterval() { + return interval; + } + + public void setInterval(long interval) { + this.interval = interval; + } + + public String getNotification() { + return notification; + } + + public void setNotification(String notification) { + this.notification = notification; + } + + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } + + public Target getTarget() { + return target; + } + + public void setTarget(Target target) { + this.target = target; + } + + public Crawler getCrawler() { + return crawler; + } + + public void setCrawler(Crawler crawler) { + this.crawler = crawler; + } +} diff --git a/src/main/java/com/loafle/overflow/sensor/model/SensorItem.java b/src/main/java/com/loafle/overflow/sensor/model/SensorItem.java new file mode 100644 index 0000000..4c84216 --- /dev/null +++ b/src/main/java/com/loafle/overflow/sensor/model/SensorItem.java @@ -0,0 +1,94 @@ +package com.loafle.overflow.sensor.model; + +import com.loafle.overflow.crawler.model.Crawler; + +import javax.persistence.*; +import java.util.Date; + +/** + * Created by root on 17. 6. 9. + */ +@Entity +public class SensorItem { + + @Id + @GeneratedValue(strategy= GenerationType.IDENTITY) + private Long id; + + @Column(name="NAME", nullable=false) + private String name; + + @Column(name="DESCRIPTION", nullable=false) + private String description; + + @Column(name="DATA_TYPE",nullable=false) + private String dataType; + + @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = true) + private Date createDate; + + @ManyToOne + @Column(name="CRAWLER_ID",nullable=false) + private Crawler crawler; + + @ManyToOne + @Column(name="SENSOR_ITEM_CATEGORY_ID",nullable=false) + private SensorItemCategory sensorItemCategory; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getDataType() { + return dataType; + } + + public void setDataType(String dataType) { + this.dataType = dataType; + } + + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } + + public Crawler getCrawler() { + return crawler; + } + + public void setCrawler(Crawler crawler) { + this.crawler = crawler; + } + + public SensorItemCategory getSensorItemCategory() { + return sensorItemCategory; + } + + public void setSensorItemCategory(SensorItemCategory sensorItemCategory) { + this.sensorItemCategory = sensorItemCategory; + } +} diff --git a/src/main/java/com/loafle/overflow/sensor/model/SensorItemCategory.java b/src/main/java/com/loafle/overflow/sensor/model/SensorItemCategory.java new file mode 100644 index 0000000..b9ee051 --- /dev/null +++ b/src/main/java/com/loafle/overflow/sensor/model/SensorItemCategory.java @@ -0,0 +1,56 @@ +package com.loafle.overflow.sensor.model; + +import javax.persistence.*; +import java.util.Date; + +/** + * Created by root on 17. 6. 9. + */ +@Entity +public class SensorItemCategory { + + @Id + @GeneratedValue(strategy= GenerationType.IDENTITY) + private Long id; + + @Column(name="NAME", nullable=false) + private String name; + + @Column(name="DESCRIPTION", nullable=false) + private String description; + + @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = true) + private Date createDate; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } +} diff --git a/src/main/java/com/loafle/overflow/sensor/model/SensorItemMapping.java b/src/main/java/com/loafle/overflow/sensor/model/SensorItemMapping.java new file mode 100644 index 0000000..49d62b9 --- /dev/null +++ b/src/main/java/com/loafle/overflow/sensor/model/SensorItemMapping.java @@ -0,0 +1,58 @@ +package com.loafle.overflow.sensor.model; + +import javax.persistence.*; +import java.util.Date; + +/** + * Created by root on 17. 6. 9. + */ +@Entity +public class SensorItemMapping { + + @Id + @GeneratedValue(strategy= GenerationType.IDENTITY) + private Long id; + + @Column(name = "CREATE_DATE", nullable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP", insertable = false, updatable = true) + private Date createDate; + + @ManyToOne + @Column(name = "SENSOR_ID", nullable = false) + private Sensor sensor; + + @ManyToOne + @Column(name = "SENSOR_ITEM_ID", nullable = false) + private SensorItem sensorItem; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Date getCreateDate() { + return createDate; + } + + public void setCreateDate(Date createDate) { + this.createDate = createDate; + } + + public Sensor getSensor() { + return sensor; + } + + public void setSensor(Sensor sensor) { + this.sensor = sensor; + } + + public SensorItem getSensorItem() { + return sensorItem; + } + + public void setSensorItem(SensorItem sensorItem) { + this.sensorItem = sensorItem; + } +}