Sensor series
This commit is contained in:
snoop 2017-06-09 14:32:24 +09:00
parent 71df148395
commit 6fe13db22d
12 changed files with 371 additions and 0 deletions

View File

@ -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<Sensor> implements SensorDao {
}

View File

@ -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<SensorItemCategory> implements SensorItemCategoryDao {
}

View File

@ -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<SensorItem> implements SensorItemDao {
}

View File

@ -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<SensorItemMapping> implements SensorItemMappingDao {
}

View File

@ -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<Sensor> {
}

View File

@ -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<SensorItemCategory> {
}

View File

@ -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<SensorItem>{
}

View File

@ -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<SensorItemMapping> {
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}