mirror of
https://github.com/zyphlar/LanternPowerMonitor.git
synced 2024-03-08 14:07:47 +00:00
Migrating from from wiringpi to pigpio. This increases the sample rate by a factor of 3 and will allow creation of a board that can monitor over 30 breakers with a single raspberry pi.
This is based on pi4j 2.0 which is in a beta status. I have fixed a few bugs in a local version of pi4j 2.0 to get it to work but I haven't submitted those changes to pi4j yet. This change requires a migration to Java 11 and will *NOT* be backwards compatible. Upgrading to this hub software will require that java 11 and pigpio be installed on the hub. This can be done from an ssh session with the following commands: apt-get update apt-get install openjdk-11-jre-headless apt-get install pigpio Alternatively, you can download a new sd image, reflash your sd card, and re-adopt your hub.
This commit is contained in:
@@ -1,13 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.lanternsoftware.util</groupId>
|
||||
<artifactId>lantern-util-common</artifactId>
|
||||
<name>lantern-util-common</name>
|
||||
<version>1.0.0</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>com.lanternsoftware.util</groupId>
|
||||
<artifactId>util</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
@@ -43,8 +47,8 @@
|
||||
<optimize>true</optimize>
|
||||
<showDeprecation>true</showDeprecation>
|
||||
<encoding>UTF-8</encoding>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<source>${maven.compiler.source}</source>
|
||||
<target>${maven.compiler.target}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.lanternsoftware.util</groupId>
|
||||
<artifactId>lantern-util-dao-ephemeral</artifactId>
|
||||
<name>lantern-util-dao-ephemeral</name>
|
||||
<version>1.0.0</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>com.lanternsoftware.util</groupId>
|
||||
<artifactId>util</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
@@ -38,8 +42,8 @@
|
||||
<optimize>true</optimize>
|
||||
<showDeprecation>true</showDeprecation>
|
||||
<encoding>UTF-8</encoding>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<source>${maven.compiler.source}</source>
|
||||
<target>${maven.compiler.target}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
||||
@@ -1,30 +1,27 @@
|
||||
package com.lanternsoftware.util.dao.ephemeral;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.lanternsoftware.util.CollectionUtils;
|
||||
import com.lanternsoftware.util.IFilter;
|
||||
import com.lanternsoftware.util.NullUtils;
|
||||
import com.lanternsoftware.util.ResourceLoader;
|
||||
import com.lanternsoftware.util.dao.AbstractDaoProxy;
|
||||
import com.lanternsoftware.util.dao.DaoEntity;
|
||||
import com.lanternsoftware.util.dao.DaoProxyType;
|
||||
import com.lanternsoftware.util.dao.DaoQuery;
|
||||
import com.lanternsoftware.util.dao.DaoSerializer;
|
||||
import com.lanternsoftware.util.dao.DaoSort;
|
||||
import com.lanternsoftware.util.dao.annotations.PrimaryKey;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.lanternsoftware.util.CollectionUtils;
|
||||
import com.lanternsoftware.util.IFilter;
|
||||
import com.lanternsoftware.util.ITransformer;
|
||||
import com.lanternsoftware.util.NullUtils;
|
||||
import com.lanternsoftware.util.ResourceLoader;
|
||||
import com.lanternsoftware.util.dao.annotations.PrimaryKey;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.UUID;
|
||||
|
||||
public class EphemeralProxy extends AbstractDaoProxy {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(EphemeralProxy.class);
|
||||
@@ -42,16 +39,19 @@ public class EphemeralProxy extends AbstractDaoProxy {
|
||||
try {
|
||||
File file = new File(_path);
|
||||
if (file.isDirectory()) {
|
||||
for (File child : file.listFiles()) {
|
||||
if (child.getName().endsWith(".json")) {
|
||||
Class<?> clazz = null;
|
||||
try {
|
||||
clazz = Class.forName(child.getName().substring(0, child.getName().length()-5));
|
||||
} catch (ClassNotFoundException _e) {
|
||||
continue;
|
||||
File[] files = file.listFiles();
|
||||
if (files != null) {
|
||||
for (File child : files) {
|
||||
if (child.getName().endsWith(".json")) {
|
||||
Class<?> clazz;
|
||||
try {
|
||||
clazz = Class.forName(child.getName().substring(0, child.getName().length() - 5));
|
||||
} catch (ClassNotFoundException _e) {
|
||||
continue;
|
||||
}
|
||||
List<DaoEntity> entities = DaoSerializer.parseList(NullUtils.toString(ResourceLoader.loadFile(child)));
|
||||
proxy.save(clazz, entities);
|
||||
}
|
||||
List<DaoEntity> entities = DaoSerializer.parseList(NullUtils.toString(ResourceLoader.loadFile(child)));
|
||||
proxy.save(clazz, entities);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -108,18 +108,14 @@ public class EphemeralProxy extends AbstractDaoProxy {
|
||||
@Override
|
||||
public synchronized void update(Class<?> _class, DaoQuery _query, DaoEntity _changes) {
|
||||
for (DaoEntity entity : queryForEntities(DaoSerializer.getTableName(_class, getType()), _query)) {
|
||||
for (Entry<String, Object> change : _changes.entrySet()) {
|
||||
entity.put(change.getKey(), change.getValue());
|
||||
}
|
||||
entity.putAll(_changes);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized <T> T updateOne(Class<T> _class, DaoQuery _query, DaoEntity _changes) {
|
||||
DaoEntity entity = CollectionUtils.getFirst(queryForEntities(DaoSerializer.getTableName(_class, getType()), _query));
|
||||
for (Entry<String, Object> change : _changes.entrySet()) {
|
||||
entity.put(change.getKey(), change.getValue());
|
||||
}
|
||||
entity.putAll(_changes);
|
||||
return DaoSerializer.fromDaoEntity(entity, _class);
|
||||
}
|
||||
|
||||
@@ -152,18 +148,12 @@ public class EphemeralProxy extends AbstractDaoProxy {
|
||||
}
|
||||
} else if (value instanceof Integer) {
|
||||
if (((Integer) value) == 0) {
|
||||
value = new Long(getNextSequence()).intValue();
|
||||
|
||||
value = Long.valueOf(getNextSequence()).intValue();
|
||||
}
|
||||
}
|
||||
_entity.put(key, value);
|
||||
}
|
||||
pk = CollectionUtils.commaSeparated(CollectionUtils.transform(CollectionUtils.getAll(_entity, _primaryKeys), new ITransformer<Object, String>() {
|
||||
@Override
|
||||
public String transform(Object _o) {
|
||||
return DaoSerializer.toString(_o);
|
||||
}
|
||||
}));
|
||||
pk = CollectionUtils.commaSeparated(CollectionUtils.transform(CollectionUtils.getAll(_entity, _primaryKeys), DaoSerializer::toString));
|
||||
}
|
||||
else
|
||||
pk = DaoSerializer.getString(_entity, "_id");
|
||||
@@ -187,12 +177,7 @@ public class EphemeralProxy extends AbstractDaoProxy {
|
||||
IFilter<DaoEntity> filter = new QueryFilter(_query);
|
||||
Map<String, DaoEntity> table = tables.get(_tableName);
|
||||
if (table != null) {
|
||||
Iterator<DaoEntity> iter = table.values().iterator();
|
||||
while (iter.hasNext()) {
|
||||
DaoEntity entity = iter.next();
|
||||
if (filter.isFiltered(entity))
|
||||
iter.remove();
|
||||
}
|
||||
table.values().removeIf(filter::isFiltered);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -241,16 +226,16 @@ public class EphemeralProxy extends AbstractDaoProxy {
|
||||
if ((comp != null) && !DaoSerializer.getString(_daoEntity, qual.getKey()).toLowerCase().contains(((String) comp).toLowerCase()))
|
||||
return false;
|
||||
comp = child.get("$equalssIgnoreCase");
|
||||
if ((comp != null) && !DaoSerializer.getString(_daoEntity, qual.getKey()).toLowerCase().equals(((String) comp).toLowerCase()))
|
||||
if ((comp != null) && !DaoSerializer.getString(_daoEntity, qual.getKey()).equalsIgnoreCase(((String) comp)))
|
||||
return false;
|
||||
comp = child.get("$startsWithIgnoreCase");
|
||||
if ((comp != null) && !DaoSerializer.getString(_daoEntity, qual.getKey()).toLowerCase().startsWith(((String) comp).toLowerCase()))
|
||||
return false;
|
||||
comp = child.get("$in");
|
||||
if ((comp != null) && !in(_daoEntity.get(qual.getKey()), (Collection) comp))
|
||||
if ((comp != null) && !in(_daoEntity.get(qual.getKey()), (Collection<?>) comp))
|
||||
return false;
|
||||
comp = child.get("$nin");
|
||||
if ((comp != null) && in(_daoEntity.get(qual.getKey()), (Collection) comp))
|
||||
if ((comp != null) && in(_daoEntity.get(qual.getKey()), (Collection<?>) comp))
|
||||
return false;
|
||||
}
|
||||
else if ((qual.getValue() instanceof String) && NullUtils.isEqual(qual.getValue(), "$null")) {
|
||||
@@ -268,10 +253,10 @@ public class EphemeralProxy extends AbstractDaoProxy {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean in(Object field, Collection qual) {
|
||||
private boolean in(Object field, Collection<?> qual) {
|
||||
for (Object qualObject : qual) {
|
||||
if (field instanceof Collection) {
|
||||
for (Object fieldObject : (Collection) field) {
|
||||
for (Object fieldObject : (Collection<?>) field) {
|
||||
if (NullUtils.isEqual(fieldObject, qualObject))
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.lanternsoftware.util</groupId>
|
||||
<artifactId>lantern-util-dao-mongo</artifactId>
|
||||
<name>lantern-util-dao-mongo</name>
|
||||
<version>1.0.0</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>com.lanternsoftware.util</groupId>
|
||||
<artifactId>util</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
@@ -43,8 +47,8 @@
|
||||
<optimize>true</optimize>
|
||||
<showDeprecation>true</showDeprecation>
|
||||
<encoding>UTF-8</encoding>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<source>${maven.compiler.source}</source>
|
||||
<target>${maven.compiler.target}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.lanternsoftware.util</groupId>
|
||||
<artifactId>lantern-util-dao</artifactId>
|
||||
<name>lantern-util-dao</name>
|
||||
<version>1.0.0</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>com.lanternsoftware.util</groupId>
|
||||
<artifactId>util</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
@@ -38,8 +42,8 @@
|
||||
<optimize>true</optimize>
|
||||
<showDeprecation>true</showDeprecation>
|
||||
<encoding>UTF-8</encoding>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<source>${maven.compiler.source}</source>
|
||||
<target>${maven.compiler.target}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.lanternsoftware.util.dao;
|
||||
|
||||
import java.util.Arrays;
|
||||
import com.lanternsoftware.util.CollectionUtils;
|
||||
import com.lanternsoftware.util.NullUtils;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
@@ -11,10 +13,6 @@ import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
import com.lanternsoftware.util.CollectionUtils;
|
||||
import com.lanternsoftware.util.ITransformer;
|
||||
import com.lanternsoftware.util.NullUtils;
|
||||
|
||||
public abstract class AbstractDaoProxy implements IDaoProxy {
|
||||
private ExecutorService executor;
|
||||
private int maxThreads = 50;
|
||||
@@ -57,37 +55,37 @@ public abstract class AbstractDaoProxy implements IDaoProxy {
|
||||
|
||||
@Override
|
||||
public <T> Future<List<T>> queryAsync(Class<T> _class, DaoQuery _query) {
|
||||
return submit(new QueryExecution<T>(this, _class, _query));
|
||||
return submit(new QueryExecution<>(this, _class, _query));
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> Future<List<T>> queryAsync(Class<T> _class, DaoQuery _query, DaoSort _sort) {
|
||||
return submit(new QueryExecution<T>(this, _class, _query, _sort));
|
||||
return submit(new QueryExecution<>(this, _class, _query, _sort));
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> Future<List<T>> queryAsync(Class<T> _class, DaoQuery _query, Collection<String> _fields) {
|
||||
return submit(new QueryExecution<T>(this, _class, _query, _fields));
|
||||
return submit(new QueryExecution<>(this, _class, _query, _fields));
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> Future<List<T>> queryAsync(Class<T> _class, DaoQuery _query, Collection<String> _fields, DaoSort _sort) {
|
||||
return submit(new QueryExecution<T>(this, _class, _query, _fields, _sort));
|
||||
return submit(new QueryExecution<>(this, _class, _query, _fields, _sort));
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T, V> Future<List<V>> queryWithFinalizer(Class<T> _class, DaoQuery _query, Collection<String> _fields, DaoSort _sort, QueryFinalizer<T, V> _finalizer) {
|
||||
return submit(new QueryFinalizerExecution<T, V>(this, _class, _query, _fields, _sort, _finalizer));
|
||||
return submit(new QueryFinalizerExecution<>(this, _class, _query, _fields, _sort, _finalizer));
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> DaoPage<T> queryPage(Class<T> _class, DaoQuery _query, Collection<String> _fields, DaoSort _sort, int _offset, int _count) {
|
||||
return new DaoPage<T>(query(_class, _query, _fields, _sort, _offset, _count), count(_class, _query));
|
||||
return new DaoPage<>(query(_class, _query, _fields, _sort, _offset, _count), count(_class, _query));
|
||||
}
|
||||
|
||||
@Override
|
||||
public DaoPage<DaoEntity> queryForEntitiesPage(String _tableName, DaoQuery _query, Collection<String> _fields, DaoSort _sort, int _offset, int _count) {
|
||||
return new DaoPage<DaoEntity>(queryForEntities(_tableName, _query, _fields, _sort, _offset, _count), count(_tableName, _query));
|
||||
return new DaoPage<>(queryForEntities(_tableName, _query, _fields, _sort, _offset, _count), count(_tableName, _query));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -112,22 +110,22 @@ public abstract class AbstractDaoProxy implements IDaoProxy {
|
||||
|
||||
@Override
|
||||
public <T> Future<T> queryOneAsync(Class<T> _class, DaoQuery _query) {
|
||||
return submit(new QueryOneExecution<T>(this, _class, _query));
|
||||
return submit(new QueryOneExecution<>(this, _class, _query));
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> Future<T> queryOneAsync(Class<T> _class, DaoQuery _query, DaoSort _sort) {
|
||||
return submit(new QueryOneExecution<T>(this, _class, _query, _sort));
|
||||
return submit(new QueryOneExecution<>(this, _class, _query, _sort));
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> Future<T> queryOneAsync(Class<T> _class, DaoQuery _query, Collection<String> _fields) {
|
||||
return submit(new QueryOneExecution<T>(this, _class, _query, _fields));
|
||||
return submit(new QueryOneExecution<>(this, _class, _query, _fields));
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> Future<T> queryOneAsync(Class<T> _class, DaoQuery _query, Collection<String> _fields, DaoSort _sort) {
|
||||
return submit(new QueryOneExecution<T>(this, _class, _query, _fields, _sort));
|
||||
return submit(new QueryOneExecution<>(this, _class, _query, _fields, _sort));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -157,7 +155,7 @@ public abstract class AbstractDaoProxy implements IDaoProxy {
|
||||
|
||||
@Override
|
||||
public <T> DaoPage<T> queryImportantPage(Class<T> _class, DaoQuery _query, DaoSort _sort, int _offset, int _count) {
|
||||
return new DaoPage<T>(queryImportant(_class, _query, _sort, _offset, _count), count(_class, _query));
|
||||
return new DaoPage<>(queryImportant(_class, _query, _sort, _offset, _count), count(_class, _query));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -247,22 +245,12 @@ public abstract class AbstractDaoProxy implements IDaoProxy {
|
||||
|
||||
@Override
|
||||
public List<String> queryForField(Class<?> _class, DaoQuery _query, final String _field, DaoSort _sort) {
|
||||
return CollectionUtils.transform(queryForEntities(DaoSerializer.getTableName(_class, getType()), _query, Arrays.asList(_field), _sort), new ITransformer<DaoEntity, String>() {
|
||||
@Override
|
||||
public String transform(DaoEntity _daoEntity) {
|
||||
return DaoSerializer.getString(_daoEntity, _field);
|
||||
}
|
||||
});
|
||||
return CollectionUtils.transform(queryForEntities(DaoSerializer.getTableName(_class, getType()), _query, List.of(_field), _sort), _daoEntity -> DaoSerializer.getString(_daoEntity, _field));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> queryForField(String _tableName, DaoQuery _query, final String _field) {
|
||||
return CollectionUtils.transform(queryForEntities(_tableName, _query, Arrays.asList(_field)), new ITransformer<DaoEntity, String>() {
|
||||
@Override
|
||||
public String transform(DaoEntity _daoEntity) {
|
||||
return DaoSerializer.getString(_daoEntity, _field);
|
||||
}
|
||||
});
|
||||
return CollectionUtils.transform(queryForEntities(_tableName, _query, List.of(_field)), _daoEntity -> DaoSerializer.getString(_daoEntity, _field));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -272,7 +260,7 @@ public abstract class AbstractDaoProxy implements IDaoProxy {
|
||||
|
||||
@Override
|
||||
public <T> Map<String, T> save(Collection<T> _objects) {
|
||||
Map<String, T> ids = new HashMap<String, T>();
|
||||
Map<String, T> ids = new HashMap<>();
|
||||
for (T o : _objects) {
|
||||
String id = save(o);
|
||||
if (NullUtils.isNotEmpty(id))
|
||||
@@ -284,6 +272,8 @@ public abstract class AbstractDaoProxy implements IDaoProxy {
|
||||
@Override
|
||||
public Map<String, DaoEntity> save(Class<?> _class, Collection<DaoEntity> _entities) {
|
||||
Map<String, DaoEntity> ids = new HashMap<>();
|
||||
if (_entities == null)
|
||||
return ids;
|
||||
for (DaoEntity e : _entities) {
|
||||
ids.put(saveEntity(_class, e), e);
|
||||
}
|
||||
@@ -328,12 +318,7 @@ public abstract class AbstractDaoProxy implements IDaoProxy {
|
||||
}
|
||||
|
||||
protected <T> List<T> toObjects(List<DaoEntity> _entities, final Class<T> _class) {
|
||||
return CollectionUtils.transform(_entities, new ITransformer<DaoEntity, T>() {
|
||||
@Override
|
||||
public T transform(DaoEntity _daoEntity) {
|
||||
return DaoSerializer.fromDaoEntity(_daoEntity, _class, getType());
|
||||
}
|
||||
});
|
||||
return CollectionUtils.transform(_entities, _daoEntity -> DaoSerializer.fromDaoEntity(_daoEntity, _class, getType()));
|
||||
}
|
||||
protected DaoQuery prepareQuery(DaoQuery _query) {
|
||||
if (queryPreparer == null)
|
||||
|
||||
@@ -49,7 +49,7 @@ public class JdbcProxy extends AbstractJdbcProxy {
|
||||
else
|
||||
driver = "oracle.jdbc.driver.OracleDriver";
|
||||
try {
|
||||
DriverManager.registerDriver(Class.forName(driver).asSubclass(Driver.class).newInstance());
|
||||
DriverManager.registerDriver(Class.forName(driver).asSubclass(Driver.class).getDeclaredConstructor().newInstance());
|
||||
JdbcProxy proxy = new JdbcProxy(DriverManager.getConnection(_connectionString, _username, _password));
|
||||
proxy.databaseType = _type;
|
||||
return proxy;
|
||||
|
||||
@@ -2,12 +2,17 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.lanternsoftware.util</groupId>
|
||||
<artifactId>lantern-util-excel</artifactId>
|
||||
<name>lantern-util-excel</name>
|
||||
<version>1.0.0</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>com.lanternsoftware.util</groupId>
|
||||
<artifactId>util</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.lanternsoftware.util</groupId>
|
||||
@@ -38,8 +43,8 @@
|
||||
<optimize>true</optimize>
|
||||
<showDeprecation>true</showDeprecation>
|
||||
<encoding>UTF-8</encoding>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<source>${maven.compiler.source}</source>
|
||||
<target>${maven.compiler.target}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.lanternsoftware.util</groupId>
|
||||
<artifactId>lantern-util-http</artifactId>
|
||||
<name>lantern-util-http</name>
|
||||
<version>1.0.0</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>com.lanternsoftware.util</groupId>
|
||||
<artifactId>util</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
@@ -48,8 +52,8 @@
|
||||
<optimize>true</optimize>
|
||||
<showDeprecation>true</showDeprecation>
|
||||
<encoding>UTF-8</encoding>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<source>${maven.compiler.source}</source>
|
||||
<target>${maven.compiler.target}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.lanternsoftware.util</groupId>
|
||||
<artifactId>lantern-util-servlet</artifactId>
|
||||
<name>lantern-util-servlet</name>
|
||||
<version>1.0.0</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<parent>
|
||||
<groupId>com.lanternsoftware.util</groupId>
|
||||
<artifactId>util</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
@@ -44,8 +48,8 @@
|
||||
<optimize>true</optimize>
|
||||
<showDeprecation>true</showDeprecation>
|
||||
<encoding>UTF-8</encoding>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<source>${maven.compiler.source}</source>
|
||||
<target>${maven.compiler.target}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
||||
11
util/pom.xml
11
util/pom.xml
@@ -1,18 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.lanternsoftware.util</groupId>
|
||||
<artifactId>util</artifactId>
|
||||
<name>util</name>
|
||||
<version>1.0.0</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
</properties>
|
||||
<parent>
|
||||
<groupId>com.lanternsoftware</groupId>
|
||||
<artifactId>LanternPowerMonitor</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
<module>lantern-util-common</module>
|
||||
|
||||
Reference in New Issue
Block a user