use of org.openhab.persistence.jdbc.model.JdbcItem in project openhab1-addons by openhab.
the class JdbcDerbyDAO method doGetHistItemFilterQuery.
@Override
public List<HistoricItem> doGetHistItemFilterQuery(Item item, FilterCriteria filter, int numberDecimalcount, String table, String name) {
String sql = histItemFilterQueryProvider(filter, numberDecimalcount, table, name);
List<Object[]> m = Yank.queryObjectArrays(sql, null);
logger.debug("JDBC::doGetHistItemFilterQuery got Array length={}", m.size());
List<HistoricItem> items = new ArrayList<HistoricItem>();
for (int i = 0; i < m.size(); i++) {
logger.debug("JDBC::doGetHistItemFilterQuery 0='{}' 1='{}'", m.get(i)[0], m.get(i)[1]);
items.add(new JdbcItem(item.getName(), getState(item, m.get(i)[1]), objectAsDate(m.get(i)[0])));
}
return items;
}
use of org.openhab.persistence.jdbc.model.JdbcItem in project openhab1-addons by openhab.
the class JdbcBaseDAO method doGetHistItemFilterQuery.
public List<HistoricItem> doGetHistItemFilterQuery(Item item, FilterCriteria filter, int numberDecimalcount, String table, String name) {
String sql = histItemFilterQueryProvider(filter, numberDecimalcount, table, name);
logger.debug("JDBC::doGetHistItemFilterQuery sql={}", sql);
List<Object[]> m = Yank.queryObjectArrays(sql, null);
List<HistoricItem> items = new ArrayList<HistoricItem>();
for (int i = 0; i < m.size(); i++) {
items.add(new JdbcItem(item.getName(), getState(item, m.get(i)[1]), objectAsDate(m.get(i)[0])));
}
return items;
}
use of org.openhab.persistence.jdbc.model.JdbcItem in project openhab1-addons by openhab.
the class JdbcPostgresqlDAO method doGetHistItemFilterQuery.
@Override
public List<HistoricItem> doGetHistItemFilterQuery(Item item, FilterCriteria filter, int numberDecimalcount, String table, String name) {
String sql = histItemFilterQueryProvider(filter, numberDecimalcount, table, name);
logger.debug("JDBC::doGetHistItemFilterQuery sql={}", sql);
List<Object[]> m = Yank.queryObjectArrays(sql, null);
List<HistoricItem> items = new ArrayList<HistoricItem>();
for (int i = 0; i < m.size(); i++) {
items.add(new JdbcItem(item.getName(), getState(item, m.get(i)[1]), objectAsDate(m.get(i)[0])));
}
return items;
}
Aggregations