mirror of
https://github.com/zyphlar/LanternPowerMonitor.git
synced 2024-03-08 14:07:47 +00:00
Performance improvement for returning energy summaries from DB. Change the way MQTT values are posted. Add a BOM utf-8 char to the BOM csv, yo dawg, bom.
This commit is contained in:
@@ -195,6 +195,26 @@ public abstract class AbstractDaoProxy implements IDaoProxy {
|
||||
return queryForEntities(_tableName, _query, _fields, _sort, 0, -1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> DaoEntity queryForEntity(Class<T> _class, DaoQuery _query) {
|
||||
return queryForEntity(DaoSerializer.getTableName(_class, getType()), _query);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> DaoEntity queryForEntity(Class<T> _class, DaoQuery _query, DaoSort _sort) {
|
||||
return queryForEntity(DaoSerializer.getTableName(_class, getType()), _query, _sort);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> DaoEntity queryForEntity(Class<T> _class, DaoQuery _query, Collection<String> _fields) {
|
||||
return queryForEntity(DaoSerializer.getTableName(_class, getType()), _query, _fields);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> DaoEntity queryForEntity(Class<T> _class, DaoQuery _query, Collection<String> _fields, DaoSort _sort) {
|
||||
return queryForEntity(DaoSerializer.getTableName(_class, getType()), _query, _fields, _sort);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DaoEntity queryForEntity(String _tableName, DaoQuery _query) {
|
||||
return CollectionUtils.getFirst(queryForEntities(_tableName, _query, null, null, 0, 1));
|
||||
|
||||
@@ -14,14 +14,12 @@ public class DaoEntity implements Map<String, Object> {
|
||||
}
|
||||
|
||||
public DaoEntity(Document _doc) {
|
||||
map = _doc == null?new Document():_doc;
|
||||
map = (_doc == null) ? new Document() : _doc;
|
||||
}
|
||||
|
||||
public DaoEntity(Map<String, ?> _map) {
|
||||
map = new Document();
|
||||
for (Entry<String, ?> e : _map.entrySet()) {
|
||||
map.put(e.getKey(), e.getValue());
|
||||
}
|
||||
map.putAll(_map);
|
||||
}
|
||||
|
||||
public DaoEntity(String _name, Object _o) {
|
||||
|
||||
@@ -35,6 +35,10 @@ public interface IDaoProxy {
|
||||
<T> Future<List<T>> queryImportantAsync(Class<T> _class, DaoQuery _query, DaoSort _sort);
|
||||
<T> List<T> queryImportant(Class<T> _class, DaoQuery _query, DaoSort _sort, int _offset, int _count);
|
||||
<T> DaoPage<T> queryImportantPage(Class<T> _class, DaoQuery _query, DaoSort _sort, int _offset, int _count);
|
||||
<T> DaoEntity queryForEntity(Class<T> _class, DaoQuery _query);
|
||||
<T> DaoEntity queryForEntity(Class<T> _class, DaoQuery _query, DaoSort _sort);
|
||||
<T> DaoEntity queryForEntity(Class<T> _class, DaoQuery _query, Collection<String> _fields);
|
||||
<T> DaoEntity queryForEntity(Class<T> _class, DaoQuery _query, Collection<String> _fields, DaoSort _sort);
|
||||
DaoEntity queryForEntity(String _tableName, DaoQuery _query);
|
||||
DaoEntity queryForEntity(String _tableName, DaoQuery _query, DaoSort _sort);
|
||||
DaoEntity queryForEntity(String _tableName, DaoQuery _query, Collection<String> _fields);
|
||||
|
||||
Reference in New Issue
Block a user