spac mi sie chce
This commit is contained in:
1 parent
2dc62ad286
commit
6737cd101e
11 files changed
+472
-134
No files matched your search
@@ -21,4 +21,10 @@ public final class APIServicePaths {
|
||||
//GIS
|
||||
public static final String GIS_CONTROLLER = "/gis";
|
||||
public static final String GET_ALL_LAMPS = "/getLamps";
|
||||
|
||||
//SENSORS
|
||||
public static final String SENSORS_CONTROLLER = "/sensors";
|
||||
public static final String GET_SENSOR_BY_ID = "/get";
|
||||
|
||||
|
||||
}
|
||||
@@ -1,24 +1,23 @@
|
||||
package hello;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import hello.agh.edu.bazy.postgresql.gis.GisDataSource;
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ComponentScan
|
||||
@EnableAutoConfiguration
|
||||
@EnableWebMvc
|
||||
@Configuration
|
||||
/*
|
||||
@ImportResource("classpath:/database-blueprint1.xml")
|
||||
*/
|
||||
public class Application extends WebMvcConfigurerAdapter implements CommandLineRunner{
|
||||
@Autowired
|
||||
CustomerRepository repository;
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -27,36 +26,7 @@ public class Application extends WebMvcConfigurerAdapter implements CommandLineR
|
||||
|
||||
@Override
|
||||
public void run(String... args) throws Exception {
|
||||
// save a couple of customers
|
||||
repository.save(new Customer("aJack", "Bauer"));
|
||||
repository.save(new Customer("aChloe", "O'Brian"));
|
||||
repository.save(new Customer("aKim", "Bauer"));
|
||||
repository.save(new Customer("aDavid", "Palmer"));
|
||||
repository.save(new Customer("aMichelle", "Dessler"));
|
||||
|
||||
// fetch all customers
|
||||
Iterable<Customer> customers = repository.findAll();
|
||||
System.out.println("Customers found with findAll():");
|
||||
System.out.println("-------------------------------");
|
||||
for (Customer customer : customers) {
|
||||
System.out.println(customer);
|
||||
}
|
||||
System.out.println();
|
||||
|
||||
// fetch an individual customer by ID
|
||||
Customer customer = repository.findOne(1L);
|
||||
System.out.println("Customer found with findOne(1L):");
|
||||
System.out.println("--------------------------------");
|
||||
System.out.println(customer);
|
||||
System.out.println();
|
||||
|
||||
// fetch customers by last name
|
||||
List<Customer> bauers = repository.findByLastName("Bauer");
|
||||
System.out.println("Customer found with findByLastName('Bauer'):");
|
||||
System.out.println("--------------------------------------------");
|
||||
for (Customer bauer : bauers) {
|
||||
System.out.println(bauer);
|
||||
}
|
||||
|
||||
// context.close();
|
||||
}
|
||||
@@ -65,4 +35,19 @@ public class Application extends WebMvcConfigurerAdapter implements CommandLineR
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
registry.addInterceptor(new SampleInterceptor()).addPathPatterns("/**");
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@Bean(name = "gisosmDataSource")
|
||||
public GisDataSource dataSource() {
|
||||
GisDataSource dataSource = new GisDataSource();
|
||||
dataSource.setDriverClassName("org.postgis.DriverWrapper");
|
||||
dataSource.setUrl("jdbc:postgresql_postGIS://10.156.207.136:5432/osm");
|
||||
dataSource.setPassword("ztb2015");
|
||||
dataSource.setUsername("postgres");
|
||||
return dataSource; }
|
||||
|
||||
|
||||
*/
|
||||
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
package hello;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
@Entity
|
||||
@Table(name = "Customer")
|
||||
public class Customer {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private long id;
|
||||
@Column(name = "firstname")
|
||||
private String firstName;
|
||||
@Column(name = "lastname")
|
||||
private String lastName;
|
||||
|
||||
protected Customer() {
|
||||
}
|
||||
|
||||
public Customer(String firstName, String lastName) {
|
||||
this.firstName = firstName;
|
||||
this.lastName = lastName;
|
||||
}
|
||||
|
||||
public Customer(long id, String first_name, String last_name) {
|
||||
this.firstName = first_name;
|
||||
this.lastName = last_name;
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
}
|
||||
|
||||
public void setFirstName(String firstName) {
|
||||
this.firstName = firstName;
|
||||
}
|
||||
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
}
|
||||
|
||||
public void setLastName(String lastName) {
|
||||
this.lastName = lastName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format(
|
||||
"Customer[id=%d, firstName='%s', lastName='%s']",
|
||||
id, firstName, lastName);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
package hello;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
/**
|
||||
* Created by lukasgol on 13.12.14.
|
||||
*/
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/customer")
|
||||
public class CustomerController {
|
||||
|
||||
@Autowired
|
||||
CustomerRepository customerRepository;
|
||||
|
||||
@RequestMapping("/getAll")
|
||||
@ResponseBody
|
||||
Iterable<Customer> getAll() {
|
||||
return customerRepository.findAll();
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package hello;
|
||||
|
||||
import org.springframework.data.repository.CrudRepository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CustomerRepository extends CrudRepository<Customer, Long> {
|
||||
|
||||
List<Customer> findByLastName(String lastName);
|
||||
}
|
||||
@@ -0,0 +1,277 @@
|
||||
package hello;
|
||||
|
||||
/**
|
||||
* Created by lukasgol on 24.01.15.
|
||||
*/
|
||||
public class Sensor {
|
||||
int SensorId;
|
||||
String name;
|
||||
String producer;
|
||||
String model;
|
||||
String dimensions;
|
||||
String weight;
|
||||
String wirelessradiofrequency;
|
||||
String wirelessprotocol;
|
||||
String bluetooth;
|
||||
float avglifespan;
|
||||
int communicatedistancemeters;
|
||||
String installingtime;
|
||||
String protectionstandard;
|
||||
String workcondition;
|
||||
float operationmintemperature;
|
||||
float operationmaxtemperature;
|
||||
float operationmaxhumidity;
|
||||
float storagemintemparature;
|
||||
float storagemaxtemperature;
|
||||
String powersupply;
|
||||
String batterypower;
|
||||
String batterylife;
|
||||
String wirelessupdate;
|
||||
int deviceSpecificationsId;
|
||||
int sensordevice_id;
|
||||
int areatype_id;
|
||||
|
||||
public Sensor() {
|
||||
|
||||
}
|
||||
|
||||
public int getSensorId() {
|
||||
return SensorId;
|
||||
}
|
||||
|
||||
public void setSensorId(int sensorId) {
|
||||
SensorId = sensorId;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getProducer() {
|
||||
return producer;
|
||||
}
|
||||
|
||||
public void setProducer(String producer) {
|
||||
this.producer = producer;
|
||||
}
|
||||
|
||||
public String getModel() {
|
||||
return model;
|
||||
}
|
||||
|
||||
public void setModel(String model) {
|
||||
this.model = model;
|
||||
}
|
||||
|
||||
public String getDimensions() {
|
||||
return dimensions;
|
||||
}
|
||||
|
||||
public void setDimensions(String dimensions) {
|
||||
this.dimensions = dimensions;
|
||||
}
|
||||
|
||||
public String getWeight() {
|
||||
return weight;
|
||||
}
|
||||
|
||||
public void setWeight(String weight) {
|
||||
this.weight = weight;
|
||||
}
|
||||
|
||||
public String getWirelessradiofrequency() {
|
||||
return wirelessradiofrequency;
|
||||
}
|
||||
|
||||
public void setWirelessradiofrequency(String wirelessradiofrequency) {
|
||||
this.wirelessradiofrequency = wirelessradiofrequency;
|
||||
}
|
||||
|
||||
public String getWirelessprotocol() {
|
||||
return wirelessprotocol;
|
||||
}
|
||||
|
||||
public void setWirelessprotocol(String wirelessprotocol) {
|
||||
this.wirelessprotocol = wirelessprotocol;
|
||||
}
|
||||
|
||||
public String getBluetooth() {
|
||||
return bluetooth;
|
||||
}
|
||||
|
||||
public void setBluetooth(String bluetooth) {
|
||||
this.bluetooth = bluetooth;
|
||||
}
|
||||
|
||||
public float getAvglifespan() {
|
||||
return avglifespan;
|
||||
}
|
||||
|
||||
public void setAvglifespan(float avglifespan) {
|
||||
this.avglifespan = avglifespan;
|
||||
}
|
||||
|
||||
public int getCommunicatedistancemeters() {
|
||||
return communicatedistancemeters;
|
||||
}
|
||||
|
||||
public void setCommunicatedistancemeters(int communicatedistancemeters) {
|
||||
this.communicatedistancemeters = communicatedistancemeters;
|
||||
}
|
||||
|
||||
public String getInstallingtime() {
|
||||
return installingtime;
|
||||
}
|
||||
|
||||
public void setInstallingtime(String installingtime) {
|
||||
this.installingtime = installingtime;
|
||||
}
|
||||
|
||||
public String getProtectionstandard() {
|
||||
return protectionstandard;
|
||||
}
|
||||
|
||||
public void setProtectionstandard(String protectionstandard) {
|
||||
this.protectionstandard = protectionstandard;
|
||||
}
|
||||
|
||||
public String getWorkcondition() {
|
||||
return workcondition;
|
||||
}
|
||||
|
||||
public void setWorkcondition(String workcondition) {
|
||||
this.workcondition = workcondition;
|
||||
}
|
||||
|
||||
public float getOperationmintemperature() {
|
||||
return operationmintemperature;
|
||||
}
|
||||
|
||||
public void setOperationmintemperature(float operationmintemperature) {
|
||||
this.operationmintemperature = operationmintemperature;
|
||||
}
|
||||
|
||||
public float getOperationmaxtemperature() {
|
||||
return operationmaxtemperature;
|
||||
}
|
||||
|
||||
public void setOperationmaxtemperature(float operationmaxtemperature) {
|
||||
this.operationmaxtemperature = operationmaxtemperature;
|
||||
}
|
||||
|
||||
public float getOperationmaxhumidity() {
|
||||
return operationmaxhumidity;
|
||||
}
|
||||
|
||||
public void setOperationmaxhumidity(float operationmaxhumidity) {
|
||||
this.operationmaxhumidity = operationmaxhumidity;
|
||||
}
|
||||
|
||||
public float getStoragemintemparature() {
|
||||
return storagemintemparature;
|
||||
}
|
||||
|
||||
public void setStoragemintemparature(float storagemintemparature) {
|
||||
this.storagemintemparature = storagemintemparature;
|
||||
}
|
||||
|
||||
public float getStoragemaxtemperature() {
|
||||
return storagemaxtemperature;
|
||||
}
|
||||
|
||||
public void setStoragemaxtemperature(float storagemaxtemperature) {
|
||||
this.storagemaxtemperature = storagemaxtemperature;
|
||||
}
|
||||
|
||||
public String getPowersupply() {
|
||||
return powersupply;
|
||||
}
|
||||
|
||||
public void setPowersupply(String powersupply) {
|
||||
this.powersupply = powersupply;
|
||||
}
|
||||
|
||||
public String getBatterypower() {
|
||||
return batterypower;
|
||||
}
|
||||
|
||||
public void setBatterypower(String batterypower) {
|
||||
this.batterypower = batterypower;
|
||||
}
|
||||
|
||||
public String getBatterylife() {
|
||||
return batterylife;
|
||||
}
|
||||
|
||||
public void setBatterylife(String batterylife) {
|
||||
this.batterylife = batterylife;
|
||||
}
|
||||
|
||||
public String getWirelessupdate() {
|
||||
return wirelessupdate;
|
||||
}
|
||||
|
||||
public void setWirelessupdate(String wirelessupdate) {
|
||||
this.wirelessupdate = wirelessupdate;
|
||||
}
|
||||
|
||||
public int getDeviceSpecificationsId() {
|
||||
return deviceSpecificationsId;
|
||||
}
|
||||
|
||||
public void setDeviceSpecificationsId(int deviceSpecificationsId) {
|
||||
this.deviceSpecificationsId = deviceSpecificationsId;
|
||||
}
|
||||
|
||||
public int getSensordevice_id() {
|
||||
return sensordevice_id;
|
||||
}
|
||||
|
||||
public void setSensordevice_id(int sensordevice_id) {
|
||||
this.sensordevice_id = sensordevice_id;
|
||||
}
|
||||
|
||||
public int getAreatype_id() {
|
||||
return areatype_id;
|
||||
}
|
||||
|
||||
public void setAreatype_id(int areatype_id) {
|
||||
this.areatype_id = areatype_id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Sensor{" +
|
||||
"SensorId=" + SensorId +
|
||||
", name='" + name + '\'' +
|
||||
", producer='" + producer + '\'' +
|
||||
", model='" + model + '\'' +
|
||||
", dimensions='" + dimensions + '\'' +
|
||||
", weight='" + weight + '\'' +
|
||||
", wirelessradiofrequency='" + wirelessradiofrequency + '\'' +
|
||||
", wirelessprotocol='" + wirelessprotocol + '\'' +
|
||||
", bluetooth='" + bluetooth + '\'' +
|
||||
", avglifespan=" + avglifespan +
|
||||
", communicatedistancemeters=" + communicatedistancemeters +
|
||||
", installingtime='" + installingtime + '\'' +
|
||||
", protectionstandard='" + protectionstandard + '\'' +
|
||||
", workcondition='" + workcondition + '\'' +
|
||||
", operationmintemperature=" + operationmintemperature +
|
||||
", operationmaxtemperature=" + operationmaxtemperature +
|
||||
", operationmaxhumidity=" + operationmaxhumidity +
|
||||
", storagemintemparature=" + storagemintemparature +
|
||||
", storagemaxtemperature=" + storagemaxtemperature +
|
||||
", powersupply='" + powersupply + '\'' +
|
||||
", batterypower='" + batterypower + '\'' +
|
||||
", batterylife='" + batterylife + '\'' +
|
||||
", wirelessupdate='" + wirelessupdate + '\'' +
|
||||
", deviceSpecificationsId=" + deviceSpecificationsId +
|
||||
", sensordevice_id=" + sensordevice_id +
|
||||
", areatype_id=" + areatype_id +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package hello.agh.edu.bazy;
|
||||
|
||||
import hello.APIServicePaths;
|
||||
import hello.Sensor;
|
||||
import hello.agh.edu.bazy.gis.dbApi.SensorsdbApi;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by lukasgol on 24.01.15.
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping(APIServicePaths.SENSORS_CONTROLLER)
|
||||
public class SensorsControllers {
|
||||
|
||||
@Autowired
|
||||
SensorsdbApi sensorsdbApi;
|
||||
|
||||
@RequestMapping(value = APIServicePaths.GET_SENSOR_BY_ID+"/{id}")
|
||||
@ResponseBody
|
||||
List<Sensor> getSensorById(@PathVariable("id") int id) {
|
||||
return sensorsdbApi.getObjectDetailById(id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,13 +23,18 @@ public class GisdbApi {
|
||||
@Autowired
|
||||
JdbcTemplate gisJdbcTemplate;
|
||||
|
||||
public List<GisLamp> getAllLamps() {
|
||||
public GisdbApi() {
|
||||
GisDataSource dataSource = new GisDataSource();
|
||||
dataSource.setDriverClassName("org.postgis.DriverWrapper");
|
||||
dataSource.setUrl("jdbc:postgresql_postGIS://10.156.207.136:5432/osm");
|
||||
dataSource.setPassword("ztb2015");
|
||||
dataSource.setUsername("postgres");
|
||||
gisJdbcTemplate.setDataSource(dataSource);
|
||||
JdbcTemplate template = new JdbcTemplate();
|
||||
template.setDataSource(dataSource);
|
||||
gisJdbcTemplate= template;
|
||||
}
|
||||
|
||||
public List<GisLamp> getAllLamps() {
|
||||
return gisJdbcTemplate.query(GET_ALL_LAMPS_COORDINATES,new GisRowMapperForLamps());
|
||||
}
|
||||
public int putLamp(double x,double y){
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
package hello.agh.edu.bazy.gis.dbApi;
|
||||
|
||||
import hello.Sensor;
|
||||
import hello.agh.edu.bazy.postgresql.gis.GisDataSource;
|
||||
import hello.agh.edu.bazy.row.mappers.SensorsRowMapper;
|
||||
import hello.agh.edu.bazy.row.mappers.SensorsRowMapper;
|
||||
import org.postgis.PGgeometry;
|
||||
import org.postgis.Point;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.jdbc.core.RowMapper;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by lukasgol on 24.01.15.
|
||||
*/
|
||||
@Component
|
||||
|
||||
public class SensorsdbApi {
|
||||
|
||||
private static final String GET_OBJECT_BY_ID = "SELECT name FROM areaTypes at LEFT JOIN deviceSpecifications ds ON at.id = ds.areaType_id WHERE ds.id = ? ";
|
||||
private static final String GET_OBJECT_DETAIL_BY_ID = "SELECT * FROM sensorDevices sd LEFT JOIN deviceSpecifications ds ON sd.id = ds.sensorDevice_id WHERE ds.id = ?";
|
||||
private static final String OBJECT_COLUM_NNAME = "name";
|
||||
|
||||
JdbcTemplate sensorsJdbcTemplate;
|
||||
|
||||
public void setSensortJdbcTemplate(JdbcTemplate sensorsJdbcTemplate) {
|
||||
this.sensorsJdbcTemplate = sensorsJdbcTemplate;
|
||||
}
|
||||
|
||||
public List<String> getObjectById(int id) {
|
||||
return sensorsJdbcTemplate.query(GET_OBJECT_BY_ID,new Object[]{id},new RowMapper<String>() {
|
||||
@Override
|
||||
public String mapRow(ResultSet rs, int rowNum) throws SQLException {
|
||||
|
||||
return rs.getObject(OBJECT_COLUM_NNAME).toString();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public List<Sensor> getObjectDetailById(int id) {
|
||||
List<Sensor> l= sensorsJdbcTemplate.query(GET_OBJECT_DETAIL_BY_ID,new Object[]{id},new SensorsRowMapper());
|
||||
return sensorsJdbcTemplate.query(GET_OBJECT_DETAIL_BY_ID,new Object[]{id},new SensorsRowMapper());
|
||||
}
|
||||
|
||||
public SensorsdbApi() {
|
||||
GisDataSource dataSource = new GisDataSource();
|
||||
dataSource.setDriverClassName("org.postgresql.Driver");
|
||||
dataSource.setUrl("jdbc:postgresql://10.156.207.136:5432/sensors");
|
||||
dataSource.setPassword("ztb2015");
|
||||
dataSource.setUsername("postgres");
|
||||
JdbcTemplate template = new JdbcTemplate();
|
||||
template.setDataSource(dataSource);
|
||||
sensorsJdbcTemplate=template;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package hello.agh.edu.bazy.postgresql.gis;
|
||||
|
||||
import org.postgresql.jdbc4.Jdbc4Connection;
|
||||
import org.springframework.jdbc.datasource.DriverManagerDataSource;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
/**
|
||||
* Created by lukasgol on 24.01.15.
|
||||
*/
|
||||
public class sensorsDataSource extends DriverManagerDataSource {
|
||||
|
||||
@Override
|
||||
public java.sql.Connection getConnection() throws SQLException {
|
||||
Jdbc4Connection connection = (Jdbc4Connection) super.getConnection();
|
||||
return connection;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package hello.agh.edu.bazy.row.mappers;
|
||||
|
||||
import hello.Sensor;
|
||||
import org.postgis.PGgeometry;
|
||||
import org.postgis.Point;
|
||||
import org.springframework.jdbc.core.RowMapper;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
/**
|
||||
* Created by lukasgol on 24.01.15.
|
||||
*/
|
||||
public class SensorsRowMapper implements RowMapper<Sensor> {
|
||||
|
||||
private static final String COORDINATE_COLUM_NNAME = "st_transform";
|
||||
|
||||
@Override
|
||||
public Sensor mapRow(ResultSet rs, int rowNum) throws SQLException {
|
||||
Sensor sensor=new Sensor();
|
||||
sensor.setSensorId(rs.getInt("id"));
|
||||
sensor.setName(rs.getString("name"));
|
||||
sensor.setProducer(rs.getString("producer"));
|
||||
sensor.setModel(rs.getString("Model"));
|
||||
sensor.setDimensions(rs.getString("dimensions"));
|
||||
sensor.setWeight(rs.getString("weight"));
|
||||
sensor.setWirelessradiofrequency(rs.getString("wirelessradiofrequency"));
|
||||
sensor.setWirelessprotocol(rs.getString("wirelessprotocol"));
|
||||
sensor.setBluetooth(rs.getString("bluetooth"));
|
||||
sensor.setAvglifespan(rs.getFloat("avglifespan"));
|
||||
sensor.setCommunicatedistancemeters(rs.getInt("communicatedistancemeters"));
|
||||
sensor.setInstallingtime(rs.getString("installingtime"));
|
||||
sensor.setProtectionstandard(rs.getString("protectionstandard"));
|
||||
sensor.setProtectionstandard(rs.getString("protectionstandard"));
|
||||
sensor.setWorkcondition(rs.getString("workcondition"));
|
||||
sensor.setOperationmintemperature(rs.getFloat("operationmintemperature"));
|
||||
sensor.setOperationmaxtemperature(rs.getFloat("operationmaxtemperature"));
|
||||
sensor.setOperationmaxhumidity(rs.getFloat("operationmaxhumidity"));
|
||||
sensor.setStoragemintemparature(rs.getFloat("storagemintemparature"));
|
||||
sensor.setStoragemaxtemperature(rs.getFloat("storagemaxtemperature"));
|
||||
sensor.setPowersupply(rs.getString("powersupply"));
|
||||
sensor.setBatterypower(rs.getString("batterypower"));
|
||||
sensor.setBatterylife(rs.getString("batterylife"));
|
||||
sensor.setWirelessupdate(rs.getString("wirelessupdate"));
|
||||
sensor.setDeviceSpecificationsId(rs.getInt(25));
|
||||
sensor.setSensordevice_id(rs.getInt("sensordevice_id"));
|
||||
sensor.setAreatype_id(rs.getInt("areatype_id"));
|
||||
return sensor;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user