diff --git a/modality-api-client/pom.xml b/modality-api-client/pom.xml
index bb0b7af..fcac94a 100644
--- a/modality-api-client/pom.xml
+++ b/modality-api-client/pom.xml
@@ -22,7 +22,7 @@ under the License.
com.republicate.modality
modality
- 1.1
+ 2.0
modality-api-client
diff --git a/modality-api-server/pom.xml b/modality-api-server/pom.xml
index ebcfc28..98ed12b 100644
--- a/modality-api-server/pom.xml
+++ b/modality-api-server/pom.xml
@@ -22,7 +22,7 @@ under the License.
com.republicate.modality
modality
- 1.1
+ 2.0
modality-api-server
jar
diff --git a/modality-core/pom.xml b/modality-core/pom.xml
index 23b1627..b71236b 100644
--- a/modality-core/pom.xml
+++ b/modality-core/pom.xml
@@ -24,7 +24,7 @@
com.republicate.modality
modality
- 1.1
+ 2.0
modality-core
@@ -87,6 +87,11 @@
commons-io
2.11.0
+
+ com.republicate
+ essential-json
+ 2.6.3
+
junit
junit
diff --git a/modality-core/src/main/java/com/republicate/modality/Entity.java b/modality-core/src/main/java/com/republicate/modality/Entity.java
index b00ff99..2bd34ca 100644
--- a/modality-core/src/main/java/com/republicate/modality/Entity.java
+++ b/modality-core/src/main/java/com/republicate/modality/Entity.java
@@ -20,10 +20,9 @@
*/
import com.republicate.modality.impl.BaseEntity;
-import com.republicate.modality.util.TypeUtils;
+import com.republicate.modality.util.ConversionUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import java.io.Serializable;
import java.lang.reflect.Method;
@@ -63,7 +62,7 @@ public Iterator iterator()
public long getCount() throws SQLException
{
- return TypeUtils.toLong(getCountAttribute().evaluate());
+ return ConversionUtils.toLong(getCountAttribute().evaluate());
}
public Instance fetch(Serializable... key) throws SQLException
diff --git a/modality-core/src/main/java/com/republicate/modality/Instance.java b/modality-core/src/main/java/com/republicate/modality/Instance.java
index 53f55f9..4e9eda9 100644
--- a/modality-core/src/main/java/com/republicate/modality/Instance.java
+++ b/modality-core/src/main/java/com/republicate/modality/Instance.java
@@ -19,19 +19,17 @@
* under the License.
*/
-import com.republicate.modality.filter.Filter;
+import com.republicate.json.Json;
import com.republicate.modality.filter.ValueFilters;
import com.republicate.modality.sql.RowValues;
import com.republicate.modality.util.ChainedMap;
-import com.republicate.modality.util.SlotTreeMap;
-import com.republicate.modality.util.TypeUtils;
+import com.republicate.modality.util.ConversionUtils;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.sql.SQLException;
-import java.util.Arrays;
import java.util.BitSet;
import java.util.Calendar;
import java.util.Date;
@@ -39,10 +37,9 @@
import java.util.List;
import java.util.Map;
import java.util.Objects;
-import java.util.Optional;
import java.util.function.Consumer;
-public class Instance extends SlotTreeMap
+public class Instance extends Json.Object
{
public Instance(Model model)
{
@@ -120,112 +117,112 @@ public Serializable evaluate(String name, Serializable... params) throws SQLExce
public String evaluateString(String name, Map params) throws SQLException
{
- return TypeUtils.toString(evaluate(name, params));
+ return ConversionUtils.toString(evaluate(name, params));
}
public Character evaluateChar(String name, Map params) throws SQLException
{
- return TypeUtils.toChar(evaluate(name, params));
+ return ConversionUtils.toChar(evaluate(name, params));
}
public Boolean evaluateBoolean(String name, Map params) throws SQLException
{
- return TypeUtils.toBoolean(evaluate(name, params));
+ return ConversionUtils.toBoolean(evaluate(name, params));
}
public Byte evaluateByte(String name, Map params) throws SQLException
{
- return TypeUtils.toByte(evaluate(name, params));
+ return ConversionUtils.toByte(evaluate(name, params));
}
public Short evaluateShort(String name, Map params) throws SQLException
{
- return TypeUtils.toShort(evaluate(name, params));
+ return ConversionUtils.toShort(evaluate(name, params));
}
public Integer evaluateInteger(String name, Map params) throws SQLException
{
- return TypeUtils.toInteger(evaluate(name, params));
+ return ConversionUtils.toInteger(evaluate(name, params));
}
public Long evaluateLong(String name, Map params) throws SQLException
{
- return TypeUtils.toLong(evaluate(name, params));
+ return ConversionUtils.toLong(evaluate(name, params));
}
public Float evaluateFloat(String name, Map params) throws SQLException
{
- return TypeUtils.toFloat(evaluate(name, params));
+ return ConversionUtils.toFloat(evaluate(name, params));
}
public Double evaluateDouble(String name, Map params) throws SQLException
{
- return TypeUtils.toDouble(evaluate(name, params));
+ return ConversionUtils.toDouble(evaluate(name, params));
}
public Date evaluateDate(String name, Map params) throws SQLException
{
- return TypeUtils.toDate(evaluate(name, params));
+ return ConversionUtils.toDate(evaluate(name, params));
}
public Calendar evaluateCalendar(String name, Map params) throws SQLException
{
- return TypeUtils.toCalendar(evaluate(name, params));
+ return ConversionUtils.toCalendar(evaluate(name, params));
}
public String evaluateString(String name, Serializable... params) throws SQLException
{
- return TypeUtils.toString(evaluate(name, params));
+ return ConversionUtils.toString(evaluate(name, params));
}
public Character evaluateChar(String name, Serializable... params) throws SQLException
{
- return TypeUtils.toChar(evaluate(name, params));
+ return ConversionUtils.toChar(evaluate(name, params));
}
public Boolean evaluateBoolean(String name, Serializable... params) throws SQLException
{
- return TypeUtils.toBoolean(evaluate(name, params));
+ return ConversionUtils.toBoolean(evaluate(name, params));
}
public Byte evaluateByte(String name, Serializable... params) throws SQLException
{
- return TypeUtils.toByte(evaluate(name, params));
+ return ConversionUtils.toByte(evaluate(name, params));
}
public Short evaluateShort(String name, Serializable... params) throws SQLException
{
- return TypeUtils.toShort(evaluate(name, params));
+ return ConversionUtils.toShort(evaluate(name, params));
}
public Integer evaluateInteger(String name, Serializable... params) throws SQLException
{
- return TypeUtils.toInteger(evaluate(name, params));
+ return ConversionUtils.toInteger(evaluate(name, params));
}
public Long evaluateLong(String name, Serializable... params) throws SQLException
{
- return TypeUtils.toLong(evaluate(name, params));
+ return ConversionUtils.toLong(evaluate(name, params));
}
public Float evaluateFloat(String name, Serializable... params) throws SQLException
{
- return TypeUtils.toFloat(evaluate(name, params));
+ return ConversionUtils.toFloat(evaluate(name, params));
}
public Double evaluateDouble(String name, Serializable... params) throws SQLException
{
- return TypeUtils.toDouble(evaluate(name, params));
+ return ConversionUtils.toDouble(evaluate(name, params));
}
public Date evaluateDate(String name, Serializable... params) throws SQLException
{
- return TypeUtils.toDate(evaluate(name, params));
+ return ConversionUtils.toDate(evaluate(name, params));
}
public Calendar evaluateCalendar(String name, Serializable... params) throws SQLException
{
- return TypeUtils.toCalendar(evaluate(name, params));
+ return ConversionUtils.toCalendar(evaluate(name, params));
}
public Instance retrieve(String name, Map params) throws SQLException
@@ -278,32 +275,32 @@ public long perform(String name, Serializable... params) throws SQLException
public String getString(String name)
{
- return TypeUtils.toString(get(name));
+ return ConversionUtils.toString(get(name));
}
public Character getChar(String name)
{
- return TypeUtils.toChar(get(name));
+ return ConversionUtils.toChar(get(name));
}
public Boolean getBoolean(String name)
{
- return TypeUtils.toBoolean(get(name));
+ return ConversionUtils.toBoolean(get(name));
}
public Byte getByte(String name)
{
- return TypeUtils.toByte(get(name));
+ return ConversionUtils.toByte(get(name));
}
public Short getShort(String name)
{
- return TypeUtils.toShort(get(name));
+ return ConversionUtils.toShort(get(name));
}
public Integer getInteger(String name)
{
- return TypeUtils.toInteger(get(name));
+ return ConversionUtils.toInteger(get(name));
}
public Integer getInt(String name)
@@ -313,27 +310,27 @@ public Integer getInt(String name)
public Long getLong(String name)
{
- return TypeUtils.toLong(get(name));
+ return ConversionUtils.toLong(get(name));
}
public Float getFloat(String name)
{
- return TypeUtils.toFloat(get(name));
+ return ConversionUtils.toFloat(get(name));
}
public Double getDouble(String name)
{
- return TypeUtils.toDouble(get(name));
+ return ConversionUtils.toDouble(get(name));
}
public Date getDate(String name)
{
- return TypeUtils.toDate(get(name));
+ return ConversionUtils.toDate(get(name));
}
public Calendar getCalendar(String name)
{
- return TypeUtils.toCalendar(get(name));
+ return ConversionUtils.toCalendar(get(name));
}
public final Model getModel()
@@ -520,7 +517,7 @@ public final Serializable put(String key, Serializable value)
{
if (column.isKeyColumn())
{
- if (!TypeUtils.sameValues(ret, value))
+ if (!ConversionUtils.sameValues(ret, value))
{
persisted = false;
}
@@ -540,7 +537,7 @@ public final Serializable put(String key, Serializable value)
* @return equality status
*/
@Override
- public boolean equals(final Object o)
+ public boolean equals(final java.lang.Object o)
{
return (o instanceof Instance)
&& getEntity() == ((Instance)o).getEntity()
diff --git a/modality-core/src/main/java/com/republicate/modality/ScalarAttribute.java b/modality-core/src/main/java/com/republicate/modality/ScalarAttribute.java
index 4094c55..1afe962 100644
--- a/modality-core/src/main/java/com/republicate/modality/ScalarAttribute.java
+++ b/modality-core/src/main/java/com/republicate/modality/ScalarAttribute.java
@@ -21,7 +21,7 @@
import com.republicate.modality.impl.AttributeHolder;
import com.republicate.modality.sql.PooledStatement;
-import com.republicate.modality.util.TypeUtils;
+import com.republicate.modality.util.ConversionUtils;
import java.io.Serializable;
import java.sql.ResultSet;
@@ -86,71 +86,71 @@ public String getQueryMethodName()
public String getString(Serializable... paramValues) throws SQLException
{
- return TypeUtils.toString(evaluate(paramValues));
+ return ConversionUtils.toString(evaluate(paramValues));
}
public String getString(Map source) throws SQLException
{
- return TypeUtils.toString(evaluate(source));
+ return ConversionUtils.toString(evaluate(source));
}
public Boolean getBoolean(Serializable... paramValues) throws SQLException
{
- return TypeUtils.toBoolean(evaluate(paramValues));
+ return ConversionUtils.toBoolean(evaluate(paramValues));
}
public Boolean getBoolean(Map source) throws SQLException
{
- return TypeUtils.toBoolean(evaluate(source));
+ return ConversionUtils.toBoolean(evaluate(source));
}
public Short getShort(Serializable... paramValues) throws SQLException
{
- return TypeUtils.toShort(evaluate(paramValues));
+ return ConversionUtils.toShort(evaluate(paramValues));
}
public Short getShort(Map source) throws SQLException
{
- return TypeUtils.toShort(evaluate(source));
+ return ConversionUtils.toShort(evaluate(source));
}
public Integer getInteger(Serializable... paramValues) throws SQLException
{
- return TypeUtils.toInteger(evaluate(paramValues));
+ return ConversionUtils.toInteger(evaluate(paramValues));
}
public Integer getInteger(Map source) throws SQLException
{
- return TypeUtils.toInteger(evaluate(source));
+ return ConversionUtils.toInteger(evaluate(source));
}
public Long getLong(Serializable... paramValues) throws SQLException
{
- return TypeUtils.toLong(evaluate(paramValues));
+ return ConversionUtils.toLong(evaluate(paramValues));
}
public Long getLong(Map source) throws SQLException
{
- return TypeUtils.toLong(evaluate(source));
+ return ConversionUtils.toLong(evaluate(source));
}
public Float getFloat(Serializable... paramValues) throws SQLException
{
- return TypeUtils.toFloat(evaluate(paramValues));
+ return ConversionUtils.toFloat(evaluate(paramValues));
}
public Float getFloat(Map source) throws SQLException
{
- return TypeUtils.toFloat(evaluate(source));
+ return ConversionUtils.toFloat(evaluate(source));
}
public Double getDouble(Serializable... paramValues) throws SQLException
{
- return TypeUtils.toDouble(evaluate(paramValues));
+ return ConversionUtils.toDouble(evaluate(paramValues));
}
public Double getDouble(Map source) throws SQLException
{
- return TypeUtils.toDouble(evaluate(source));
+ return ConversionUtils.toDouble(evaluate(source));
}
}
diff --git a/modality-core/src/main/java/com/republicate/modality/WrappingInstance.java b/modality-core/src/main/java/com/republicate/modality/WrappingInstance.java
index 05903e3..07f840f 100644
--- a/modality-core/src/main/java/com/republicate/modality/WrappingInstance.java
+++ b/modality-core/src/main/java/com/republicate/modality/WrappingInstance.java
@@ -19,8 +19,8 @@
* under the License.
*/
+import com.republicate.modality.util.ConversionUtils;
import com.republicate.modality.util.Converter;
-import com.republicate.modality.util.TypeUtils;
import org.apache.commons.lang3.tuple.Pair;
import java.io.Serializable;
@@ -34,7 +34,7 @@
public class WrappingInstance extends Instance implements Wrapper
{
- public WrappingInstance(Entity entity, Object pojo)
+ public WrappingInstance(Entity entity, java.lang.Object pojo)
{
super(entity);
this.pojo = pojo;
@@ -49,7 +49,7 @@ private Serializable callSetter(Pair setter, Serializable value)
Class paramClass = setter.getRight();
try
{
- if (value != null && value.getClass() != paramClass && !TypeUtils.isMethodInvocationConvertible(paramClass, value.getClass()))
+ if (value != null && value.getClass() != paramClass && !ConversionUtils.isMethodInvocationConvertible(paramClass, value.getClass()))
{
Converter converter = getModel().getConversionHandler().getNeededConverter(paramClass, value.getClass());
if (converter == null)
@@ -58,7 +58,7 @@ private Serializable callSetter(Pair setter, Serializable value)
}
value = converter.convert(value);
}
- Object methodRet = method.invoke(pojo, value);
+ java.lang.Object methodRet = method.invoke(pojo, value);
if (methodRet != null && !(methodRet instanceof Void))
{
if (!(methodRet instanceof Serializable))
@@ -90,7 +90,7 @@ public void readValue(String columnName, Serializable value) throws SQLException
}
@Override
- public Serializable get(Object key)
+ public Serializable get(java.lang.Object key)
{
Method getter = getters.get(key);
if (getter == null)
@@ -124,7 +124,7 @@ protected Serializable putImpl(String key, Serializable value)
}
}
- private Object pojo;
+ private java.lang.Object pojo;
private Map getters = null;
private Map> setters = null;
diff --git a/modality-core/src/main/java/com/republicate/modality/config/ConfigDigester.java b/modality-core/src/main/java/com/republicate/modality/config/ConfigDigester.java
index 876aecc..c09be44 100644
--- a/modality-core/src/main/java/com/republicate/modality/config/ConfigDigester.java
+++ b/modality-core/src/main/java/com/republicate/modality/config/ConfigDigester.java
@@ -23,7 +23,7 @@
import com.republicate.modality.Model;
import com.republicate.modality.impl.AttributeHolder;
import com.republicate.modality.impl.BaseAttribute;
-import com.republicate.modality.util.TypeUtils;
+import com.republicate.modality.util.ConversionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.velocity.tools.ClassUtils;
import org.w3c.dom.Attr;
@@ -436,7 +436,7 @@ public static Object convertParamToClass(Object value, Class clazz) throws Confi
}
else if (clazz == Boolean.TYPE)
{
- ret = TypeUtils.toBoolean(value);
+ ret = ConversionUtils.toBoolean(value);
}
else if (Enum.class.isAssignableFrom(clazz) && value instanceof String)
{
diff --git a/modality-core/src/main/java/com/republicate/modality/filter/ValueFilters.java b/modality-core/src/main/java/com/republicate/modality/filter/ValueFilters.java
index 34c87a1..b1da6b3 100644
--- a/modality-core/src/main/java/com/republicate/modality/filter/ValueFilters.java
+++ b/modality-core/src/main/java/com/republicate/modality/filter/ValueFilters.java
@@ -1,7 +1,7 @@
package com.republicate.modality.filter;
+import com.republicate.modality.util.ConversionUtils;
import com.republicate.modality.util.Cryptograph;
-import com.republicate.modality.util.TypeUtils;
import org.apache.commons.lang3.ClassUtils;
import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.commons.lang3.StringUtils;
@@ -10,14 +10,11 @@
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Calendar;
-import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Optional;
-import java.util.TreeMap;
import java.util.concurrent.ConcurrentHashMap;
-import java.util.regex.Pattern;
public class ValueFilters extends ConfigurableFilters
{
@@ -26,16 +23,16 @@ public ValueFilters(String configurationPrefix)
super(configurationPrefix);
addStockFilter("lowercase", x -> String.valueOf(x).toLowerCase(Locale.ROOT));
addStockFilter("uppercase", x -> String.valueOf(x).toUpperCase(Locale.ROOT));
- addStockFilter("calendar_to_date", x -> x instanceof Calendar ? TypeUtils.toDate(x) : x);
- addStockFilter("date_to_calendar", x -> x instanceof java.sql.Date ? TypeUtils.toCalendar(x) : x);
+ addStockFilter("calendar_to_date", x -> x instanceof Calendar ? ConversionUtils.toDate(x) : x);
+ addStockFilter("date_to_calendar", x -> x instanceof java.sql.Date ? ConversionUtils.toCalendar(x) : x);
addStockFilter("number_to_boolean", x -> x instanceof Number ? ((Number)x).longValue() != 0 : x);
- addStockFilter("raw_obfuscate", x -> cryptograph.encrypt(TypeUtils.toString(x)));
- addStockFilter("raw_deobfuscate", x -> cryptograph.decrypt(TypeUtils.toBytes(x)));
- addStockFilter("obfuscate", x -> TypeUtils.base64Encode(cryptograph.encrypt(String.valueOf(x))));
- addStockFilter("deobfuscate", x -> cryptograph.decrypt(TypeUtils.base64Decode(x)));
- addStockFilter("deobfuscate_strings", x -> x instanceof String ? cryptograph.decrypt(TypeUtils.base64Decode(x)) : x);
- addStockFilter("base64_encode", x -> TypeUtils.base64Encode(x));
- addStockFilter("base64_decode", x -> TypeUtils.base64Decode(x));
+ addStockFilter("raw_obfuscate", x -> cryptograph.encrypt(ConversionUtils.toString(x)));
+ addStockFilter("raw_deobfuscate", x -> cryptograph.decrypt(ConversionUtils.toBytes(x)));
+ addStockFilter("obfuscate", x -> ConversionUtils.base64Encode(cryptograph.encrypt(String.valueOf(x))));
+ addStockFilter("deobfuscate", x -> cryptograph.decrypt(ConversionUtils.base64Decode(x)));
+ addStockFilter("deobfuscate_strings", x -> x instanceof String ? cryptograph.decrypt(ConversionUtils.base64Decode(x)) : x);
+ addStockFilter("base64_encode", x -> ConversionUtils.base64Encode(x));
+ addStockFilter("base64_decode", x -> ConversionUtils.base64Decode(x));
addStockFilter("mask", x -> null);
addStockFilter("no_html", x -> StringUtils.indexOfAny(String.valueOf(x), "<>\"") == -1 ? x : error("invalid character"));
addStockFilter("escape_html", x -> new HtmlEscaped(x));
diff --git a/modality-core/src/main/java/com/republicate/modality/impl/AttributeHolder.java b/modality-core/src/main/java/com/republicate/modality/impl/AttributeHolder.java
index 337bed2..1de3008 100644
--- a/modality-core/src/main/java/com/republicate/modality/impl/AttributeHolder.java
+++ b/modality-core/src/main/java/com/republicate/modality/impl/AttributeHolder.java
@@ -30,7 +30,7 @@
import com.republicate.modality.Transaction;
import com.republicate.modality.config.ConfigurationException;
import com.republicate.modality.sql.SqlUtils;
-import com.republicate.modality.util.TypeUtils;
+import com.republicate.modality.util.ConversionUtils;
import org.slf4j.Logger;
import java.io.Serializable;
@@ -167,112 +167,112 @@ public Serializable evaluate(String name, Map source, Serializable... params) th
public String evaluateString(String name, Map params) throws SQLException
{
- return TypeUtils.toString(evaluate(name, params));
+ return ConversionUtils.toString(evaluate(name, params));
}
public Character evaluateChar(String name, Map params) throws SQLException
{
- return TypeUtils.toChar(evaluate(name, params));
+ return ConversionUtils.toChar(evaluate(name, params));
}
public Boolean evaluateBoolean(String name, Map params) throws SQLException
{
- return TypeUtils.toBoolean(evaluate(name, params));
+ return ConversionUtils.toBoolean(evaluate(name, params));
}
public Byte evaluateByte(String name, Map params) throws SQLException
{
- return TypeUtils.toByte(evaluate(name, params));
+ return ConversionUtils.toByte(evaluate(name, params));
}
public Short evaluateShort(String name, Map params) throws SQLException
{
- return TypeUtils.toShort(evaluate(name, params));
+ return ConversionUtils.toShort(evaluate(name, params));
}
public Integer evaluateInteger(String name, Map params) throws SQLException
{
- return TypeUtils.toInteger(evaluate(name, params));
+ return ConversionUtils.toInteger(evaluate(name, params));
}
public Long evaluateLong(String name, Map params) throws SQLException
{
- return TypeUtils.toLong(evaluate(name, params));
+ return ConversionUtils.toLong(evaluate(name, params));
}
public Float evaluateFloat(String name, Map params) throws SQLException
{
- return TypeUtils.toFloat(evaluate(name, params));
+ return ConversionUtils.toFloat(evaluate(name, params));
}
public Double evaluateDouble(String name, Map params) throws SQLException
{
- return TypeUtils.toDouble(evaluate(name, params));
+ return ConversionUtils.toDouble(evaluate(name, params));
}
public Date evaluateDate(String name, Map params) throws SQLException
{
- return TypeUtils.toDate(evaluate(name, params));
+ return ConversionUtils.toDate(evaluate(name, params));
}
public Calendar evaluateCalendar(String name, Map params) throws SQLException
{
- return TypeUtils.toCalendar(evaluate(name, params));
+ return ConversionUtils.toCalendar(evaluate(name, params));
}
public String evaluateString(String name, Serializable... params) throws SQLException
{
- return TypeUtils.toString(evaluate(name, params));
+ return ConversionUtils.toString(evaluate(name, params));
}
public Character evaluateChar(String name, Serializable... params) throws SQLException
{
- return TypeUtils.toChar(evaluate(name, params));
+ return ConversionUtils.toChar(evaluate(name, params));
}
public Boolean evaluateBoolean(String name, Serializable... params) throws SQLException
{
- return TypeUtils.toBoolean(evaluate(name, params));
+ return ConversionUtils.toBoolean(evaluate(name, params));
}
public Byte evaluateByte(String name, Serializable... params) throws SQLException
{
- return TypeUtils.toByte(evaluate(name, params));
+ return ConversionUtils.toByte(evaluate(name, params));
}
public Short evaluateShort(String name, Serializable... params) throws SQLException
{
- return TypeUtils.toShort(evaluate(name, params));
+ return ConversionUtils.toShort(evaluate(name, params));
}
public Integer evaluateInteger(String name, Serializable... params) throws SQLException
{
- return TypeUtils.toInteger(evaluate(name, params));
+ return ConversionUtils.toInteger(evaluate(name, params));
}
public Long evaluateLong(String name, Serializable... params) throws SQLException
{
- return TypeUtils.toLong(evaluate(name, params));
+ return ConversionUtils.toLong(evaluate(name, params));
}
public Float evaluateFloat(String name, Serializable... params) throws SQLException
{
- return TypeUtils.toFloat(evaluate(name, params));
+ return ConversionUtils.toFloat(evaluate(name, params));
}
public Double evaluateDouble(String name, Serializable... params) throws SQLException
{
- return TypeUtils.toDouble(evaluate(name, params));
+ return ConversionUtils.toDouble(evaluate(name, params));
}
public Date evaluateDate(String name, Serializable... params) throws SQLException
{
- return TypeUtils.toDate(evaluate(name, params));
+ return ConversionUtils.toDate(evaluate(name, params));
}
public Calendar evaluateCalendar(String name, Serializable... params) throws SQLException
{
- return TypeUtils.toCalendar(evaluate(name, params));
+ return ConversionUtils.toCalendar(evaluate(name, params));
}
// ---
diff --git a/modality-core/src/main/java/com/republicate/modality/impl/BaseModel.java b/modality-core/src/main/java/com/republicate/modality/impl/BaseModel.java
index a04262e..540fa36 100644
--- a/modality-core/src/main/java/com/republicate/modality/impl/BaseModel.java
+++ b/modality-core/src/main/java/com/republicate/modality/impl/BaseModel.java
@@ -1285,7 +1285,7 @@ protected void initialize()
{
try
{
- Object obj = clazz.newInstance();
+ java.lang.Object obj = clazz.newInstance();
return new WrappingInstance(entity, obj);
}
catch (InstantiationException | IllegalAccessException e)
diff --git a/modality-core/src/main/java/com/republicate/modality/util/ConversionHandlerImpl.java b/modality-core/src/main/java/com/republicate/modality/util/ConversionHandlerImpl.java
index 4a8e18e..36dd8b4 100644
--- a/modality-core/src/main/java/com/republicate/modality/util/ConversionHandlerImpl.java
+++ b/modality-core/src/main/java/com/republicate/modality/util/ConversionHandlerImpl.java
@@ -19,12 +19,14 @@
* under the License.
*/
+import com.republicate.json.Json;
import org.apache.commons.lang3.LocaleUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.velocity.util.introspection.IntrospectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.io.IOException;
import java.io.Serializable;
import java.text.DateFormat;
import java.text.ParseException;
@@ -685,6 +687,37 @@ public java.sql.Timestamp convert(Serializable o)
}
};
standardConverterMap.put(Pair.of(java.sql.Timestamp.class, String.class), stringToTimestamp);
+
+ /* String to Json */
+
+ Converter stringToJson = new Converter()
+ {
+ @Override
+ public Json convert(Serializable o)
+ {
+ try
+ {
+ return Json.parse(String.valueOf(o));
+ }
+ catch (IOException ioe)
+ {
+ logger.warn("could not parse '{}' into an iso timestamp", o, ioe);
+ return null;
+ }
+ }
+ };
+ standardConverterMap.put(Pair.of(Json.class, String.class), stringToJson);
+
+ /* Json to String */
+ Converter jsonToString = new Converter()
+ {
+ @Override
+ public String convert(Serializable o)
+ {
+ return ((Json)o).toString();
+ }
+ };
+ standardConverterMap.put(Pair.of(String.class, Json.class), jsonToString);
}
/**
diff --git a/modality-core/src/main/java/com/republicate/modality/util/TypeUtils.java b/modality-core/src/main/java/com/republicate/modality/util/ConversionUtils.java
similarity index 99%
rename from modality-core/src/main/java/com/republicate/modality/util/TypeUtils.java
rename to modality-core/src/main/java/com/republicate/modality/util/ConversionUtils.java
index c909958..eecbe6a 100644
--- a/modality-core/src/main/java/com/republicate/modality/util/TypeUtils.java
+++ b/modality-core/src/main/java/com/republicate/modality/util/ConversionUtils.java
@@ -32,7 +32,7 @@
import java.util.Map;
import java.util.Set;
-public class TypeUtils
+public class ConversionUtils
{
protected static Logger logger = LoggerFactory.getLogger("sql-types");
diff --git a/modality-core/src/main/java/com/republicate/modality/util/SlotHashMap.java b/modality-core/src/main/java/com/republicate/modality/util/SlotHashMap.java
deleted file mode 100644
index a8ef62c..0000000
--- a/modality-core/src/main/java/com/republicate/modality/util/SlotHashMap.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package com.republicate.modality.util;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.Map;
-
-public class SlotHashMap extends HashMap implements SlotMap
-{
- public SlotHashMap() {}
-
- public SlotHashMap(Map extends String, ? extends Serializable> m)
- {
- super(m);
- }
-}
diff --git a/modality-core/src/main/java/com/republicate/modality/util/SlotMap.java b/modality-core/src/main/java/com/republicate/modality/util/SlotMap.java
deleted file mode 100644
index abbb2cc..0000000
--- a/modality-core/src/main/java/com/republicate/modality/util/SlotMap.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package com.republicate.modality.util;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.io.Serializable;
-import java.util.Map;
-
-public interface SlotMap extends Map, Serializable
-{
-}
diff --git a/modality-core/src/main/java/com/republicate/modality/util/SlotTreeMap.java b/modality-core/src/main/java/com/republicate/modality/util/SlotTreeMap.java
deleted file mode 100644
index 29329f6..0000000
--- a/modality-core/src/main/java/com/republicate/modality/util/SlotTreeMap.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package com.republicate.modality.util;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.io.Serializable;
-import java.util.Map;
-import java.util.TreeMap;
-
-public class SlotTreeMap extends TreeMap implements SlotMap
-{
- public SlotTreeMap() {}
-
- public SlotTreeMap(java.util.Comparator comparator)
- {
- super(comparator);
- }
-
- public SlotTreeMap(Map extends String, ? extends Serializable> m)
- {
- super(m);
- }
-}
diff --git a/modality-core/src/main/java/com/republicate/modality/velosurf/Velosurf.java b/modality-core/src/main/java/com/republicate/modality/velosurf/Velosurf.java
index aa879b1..7ce075c 100644
--- a/modality-core/src/main/java/com/republicate/modality/velosurf/Velosurf.java
+++ b/modality-core/src/main/java/com/republicate/modality/velosurf/Velosurf.java
@@ -20,11 +20,10 @@
*/
import com.republicate.modality.Model;
-import com.republicate.modality.config.ConfigDigester;
import com.republicate.modality.config.ConfigurationException;
import com.republicate.modality.util.AESCryptograph;
+import com.republicate.modality.util.ConversionUtils;
import com.republicate.modality.util.Cryptograph;
-import com.republicate.modality.util.TypeUtils;
import org.apache.velocity.tools.XmlUtils;
import org.w3c.dom.Element;
import org.xml.sax.InputSource;
@@ -87,12 +86,12 @@ protected void initObuscator(String seed)
public String obfuscate(String clear)
{
- return TypeUtils.base64Encode(obfuscator.encrypt(clear));
+ return ConversionUtils.base64Encode(obfuscator.encrypt(clear));
}
public String deobfuscate(String obfuscated)
{
- return obfuscator.decrypt(TypeUtils.base64Decode(obfuscated));
+ return obfuscator.decrypt(ConversionUtils.base64Decode(obfuscated));
}
private Cryptograph obfuscator = null;
diff --git a/modality-examples/modality-example-bookshelf/pom.xml b/modality-examples/modality-example-bookshelf/pom.xml
index b15c87a..d372331 100644
--- a/modality-examples/modality-example-bookshelf/pom.xml
+++ b/modality-examples/modality-example-bookshelf/pom.xml
@@ -22,7 +22,7 @@ under the License.
com.republicate.modality
modality-examples
- 1.1
+ 2.0
modality-example-bookshelf
diff --git a/modality-examples/pom.xml b/modality-examples/pom.xml
index ae03b33..a14ffb5 100644
--- a/modality-examples/pom.xml
+++ b/modality-examples/pom.xml
@@ -22,7 +22,7 @@ under the License.
com.republicate.modality
modality
- 1.1
+ 2.0
modality-examples
diff --git a/modality-webapp-auth/pom.xml b/modality-webapp-auth/pom.xml
index bf6e893..931dbdb 100644
--- a/modality-webapp-auth/pom.xml
+++ b/modality-webapp-auth/pom.xml
@@ -22,7 +22,7 @@ under the License.
com.republicate.modality
modality
- 1.1
+ 2.0
modality-webapp-auth
diff --git a/modality-webapp-auth/src/main/java/com/republicate/modality/webapp/auth/BaseHTTPBasicAuthFilter.java b/modality-webapp-auth/src/main/java/com/republicate/modality/webapp/auth/BaseHTTPBasicAuthFilter.java
index e662835..1d0af3d 100644
--- a/modality-webapp-auth/src/main/java/com/republicate/modality/webapp/auth/BaseHTTPBasicAuthFilter.java
+++ b/modality-webapp-auth/src/main/java/com/republicate/modality/webapp/auth/BaseHTTPBasicAuthFilter.java
@@ -19,7 +19,7 @@
* under the License.
*/
-import com.republicate.modality.util.TypeUtils;
+import com.republicate.modality.util.ConversionUtils;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
@@ -48,7 +48,7 @@ protected USER authenticate(HttpServletRequest request) throws ServletException
USER ret = null;
if (authHeader != null && authHeader.startsWith("Basic "))
{
- byte[] decrypted = TypeUtils.base64Decode(authHeader.substring(6));
+ byte[] decrypted = ConversionUtils.base64Decode(authHeader.substring(6));
String clear = new String(decrypted, StandardCharsets.UTF_8);
int sep = clear.indexOf(':');
if (sep == -1)
diff --git a/modality-webapp-auth/src/main/java/com/republicate/modality/webapp/auth/BaseHTTPDigestAuthFilter.java b/modality-webapp-auth/src/main/java/com/republicate/modality/webapp/auth/BaseHTTPDigestAuthFilter.java
index fc05c01..ff33072 100644
--- a/modality-webapp-auth/src/main/java/com/republicate/modality/webapp/auth/BaseHTTPDigestAuthFilter.java
+++ b/modality-webapp-auth/src/main/java/com/republicate/modality/webapp/auth/BaseHTTPDigestAuthFilter.java
@@ -19,15 +19,16 @@
* under the License.
*/
-import com.republicate.modality.util.SlotHashMap;
-import com.republicate.modality.util.SlotMap;
import com.republicate.modality.webapp.auth.helpers.NonceStore;
import com.republicate.modality.webapp.util.Digester;
import com.republicate.modality.webapp.util.HttpUtils;
import org.apache.commons.lang3.tuple.Pair;
import java.io.IOException;
+import java.io.Serializable;
import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
import java.util.Optional;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
@@ -77,7 +78,7 @@ protected USER authenticate(HttpServletRequest request) throws ServletException
{
String authHeader = request.getHeader("Authenticate");
USER ret = null;
- SlotMap authParams = null;
+ Map authParams = null;
if (authHeader != null)
{
try
@@ -117,13 +118,13 @@ protected USER authenticate(HttpServletRequest request) throws ServletException
return ret;
}
- private SlotMap getAuthenticationParams(String headerValue) throws AuthenticationException
+ private Map getAuthenticationParams(String headerValue) throws AuthenticationException
{
if (!headerValue.startsWith("Digest "))
{
throw new AuthenticationException("invalid Digest authentication: " + headerValue);
}
- SlotMap ret = new SlotHashMap();
+ Map ret = new HashMap<>();
boolean hasQOP = false;
int nc = 0;
String[] parts = headerValue.substring(7).split(", *");
@@ -208,7 +209,7 @@ private SlotMap getAuthenticationParams(String headerValue) throws Authenticatio
return ret;
}
- private Pair calcExpectedResponse(SlotMap authParams, HttpServletRequest request) throws AuthenticationException
+ private Pair calcExpectedResponse(Map authParams, HttpServletRequest request) throws AuthenticationException
{
String username = (String) authParams.get("username");
String md5 = getUserRealmPasswordMD5(username);
@@ -242,7 +243,7 @@ private Pair calcExpectedResponse(SlotMap authParams, HttpServletR
protected abstract USER getUserInstance(String login) throws AuthenticationException;
- private String calcHA1(SlotMap authParams, String md5) throws AuthenticationException
+ private String calcHA1(Map authParams, String md5) throws AuthenticationException
{
String algorithm = (String)authParams.get("algorithm");
String ha1;
@@ -260,7 +261,7 @@ private String calcHA1(SlotMap authParams, String md5) throws AuthenticationExce
return ha1;
}
- private String calcHA2(SlotMap authParams, HttpServletRequest request) throws AuthenticationException
+ private String calcHA2(Map authParams, HttpServletRequest request) throws AuthenticationException
{
String qop = (String)authParams.get("qop");
String ha2;
diff --git a/modality-webapp-auth/src/main/java/com/republicate/modality/webapp/auth/HTTPDigestAuthFilter.java b/modality-webapp-auth/src/main/java/com/republicate/modality/webapp/auth/HTTPDigestAuthFilter.java
index 715c3d2..9ba3e4e 100644
--- a/modality-webapp-auth/src/main/java/com/republicate/modality/webapp/auth/HTTPDigestAuthFilter.java
+++ b/modality-webapp-auth/src/main/java/com/republicate/modality/webapp/auth/HTTPDigestAuthFilter.java
@@ -24,10 +24,11 @@
import com.republicate.modality.RowAttribute;
import com.republicate.modality.ScalarAttribute;
import com.republicate.modality.config.ConfigurationException;
-import com.republicate.modality.util.SlotHashMap;
-import com.republicate.modality.util.SlotMap;
+import java.io.Serializable;
import java.sql.SQLException;
+import java.util.HashMap;
+import java.util.Map;
import java.util.Optional;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
@@ -89,7 +90,7 @@ protected String getUserRealmPasswordMD5(String login) throws AuthenticationExce
try
{
getModel(); // force initialization
- SlotMap params = new SlotHashMap();
+ Map params = new HashMap<>();
params.put("realm", getRealm());
params.put("login", login);
return digestByLoginAttribute.getString(params);
@@ -107,7 +108,7 @@ protected Instance getUserInstance(String login) throws AuthenticationException
try
{
getModel(); // force initialization
- SlotMap params = new SlotHashMap();
+ Map params = new HashMap<>();
params.put("realm", getRealm());
params.put("login", login);
return userByLoginAttribute.retrieve(params);
diff --git a/modality-webapp-auth/src/main/java/com/republicate/modality/webapp/auth/helpers/CredentialsCheckerImpl.java b/modality-webapp-auth/src/main/java/com/republicate/modality/webapp/auth/helpers/CredentialsCheckerImpl.java
index f2ea92f..a2514f4 100644
--- a/modality-webapp-auth/src/main/java/com/republicate/modality/webapp/auth/helpers/CredentialsCheckerImpl.java
+++ b/modality-webapp-auth/src/main/java/com/republicate/modality/webapp/auth/helpers/CredentialsCheckerImpl.java
@@ -24,12 +24,13 @@
import com.republicate.modality.Model;
import com.republicate.modality.RowAttribute;
import com.republicate.modality.config.ConfigurationException;
-import com.republicate.modality.util.SlotHashMap;
-import com.republicate.modality.util.SlotMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.io.Serializable;
import java.sql.SQLException;
+import java.util.HashMap;
+import java.util.Map;
import javax.servlet.ServletException;
public class CredentialsCheckerImpl implements CredentialsChecker
@@ -59,7 +60,7 @@ public Instance checkCredentials(String realm, String login, String password) th
{
try
{
- SlotMap params = new SlotHashMap();
+ Map params = new HashMap<>();
params.put("realm", realm);
params.put("login", login);
params.put("password", password);
diff --git a/modality-webapp-auth/src/main/java/com/republicate/modality/webapp/auth/helpers/RememberMeCookieHandlerImpl.java b/modality-webapp-auth/src/main/java/com/republicate/modality/webapp/auth/helpers/RememberMeCookieHandlerImpl.java
index 4f4bc0d..e83509c 100644
--- a/modality-webapp-auth/src/main/java/com/republicate/modality/webapp/auth/helpers/RememberMeCookieHandlerImpl.java
+++ b/modality-webapp-auth/src/main/java/com/republicate/modality/webapp/auth/helpers/RememberMeCookieHandlerImpl.java
@@ -25,10 +25,8 @@
import com.republicate.modality.Model;
import com.republicate.modality.RowAttribute;
import com.republicate.modality.util.AESCryptograph;
+import com.republicate.modality.util.ConversionUtils;
import com.republicate.modality.util.Cryptograph;
-import com.republicate.modality.util.SlotHashMap;
-import com.republicate.modality.util.SlotMap;
-import com.republicate.modality.util.TypeUtils;
import com.republicate.modality.webapp.util.HttpUtils;
import org.apache.commons.lang3.RandomStringUtils;
import org.slf4j.Logger;
@@ -37,7 +35,9 @@
import java.io.Serializable;
import java.sql.SQLException;
import java.util.Arrays;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
@@ -131,7 +131,7 @@ private Instance getRememberMe(String rememberMeValue, String requestIp, String
String decrypted;
try
{
- byte[] bytes = TypeUtils.base64Decode(rememberMeValue);
+ byte[] bytes = ConversionUtils.base64Decode(rememberMeValue);
decrypted = cryptograph.decrypt(bytes);
}
catch (Exception e)
@@ -158,7 +158,7 @@ private Instance getRememberMe(String rememberMeValue, String requestIp, String
logger.debug("wrong number of user key values");
return null;
}
- SlotMap params = buildParams(pk, ip, ua, secureKey);
+ Map params = buildParams(pk, ip, ua, secureKey);
try
{
return doCheckCookie.retrieve(params);
@@ -187,7 +187,7 @@ public void setRememberMe(Instance user, HttpServletRequest request, HttpServlet
Cookie cookie = createCookie(pk, ip, ua, secureKey);
response.addCookie(cookie);
- SlotMap params = buildParams(pk, ip, ua, secureKey);
+ Map params = buildParams(pk, ip, ua, secureKey);
try
{
doCreateCookie.perform(params);
@@ -246,7 +246,7 @@ private void manageCookie(Instance user, HttpServletRequest request, HttpServlet
cookie.setMaxAge(maxAge);
response.addCookie(cookie);
- SlotMap params = buildParams(pk, ip, ua, secureKey);
+ Map params = buildParams(pk, ip, ua, secureKey);
try
{
action.perform(params);
@@ -265,9 +265,9 @@ private String getCookieValue(HttpServletRequest request)
.orElse(null);
}
- private SlotMap buildParams(Serializable[] pk, String ip, String ua, String secureKey)
+ private Map buildParams(Serializable[] pk, String ip, String ua, String secureKey)
{
- SlotMap params = new SlotHashMap();
+ Map params = new HashMap<>();
IntStream.range(0, pk.length).forEach(i -> params.put(usersPrimaryKey.get(i), pk[i]));
params.put("ip", ip);
params.put("user_agent", ua);
@@ -283,7 +283,7 @@ private Cookie createCookie(Serializable[] pk, String ip, String ua, String secu
.append('#').append(ip)
.append('#').append(ua)
.append('#').append(secureKey);
- String encrypted = TypeUtils.base64Encode(cryptograph.encrypt(cleanCookie.toString()));
+ String encrypted = ConversionUtils.base64Encode(cryptograph.encrypt(cleanCookie.toString()));
Cookie cookie = new Cookie(cookieName, encrypted);
if (cookieDomain != null)
{
diff --git a/modality-webapp-auth/src/test/java/com/republicate/modality/webapp/auth/BaseHTTPAuthTests.java b/modality-webapp-auth/src/test/java/com/republicate/modality/webapp/auth/BaseHTTPAuthTests.java
index 438b42e..ce6d31b 100644
--- a/modality-webapp-auth/src/test/java/com/republicate/modality/webapp/auth/BaseHTTPAuthTests.java
+++ b/modality-webapp-auth/src/test/java/com/republicate/modality/webapp/auth/BaseHTTPAuthTests.java
@@ -20,8 +20,6 @@
*/
import com.republicate.modality.Model;
-import com.republicate.modality.util.TypeUtils;
-import com.republicate.modality.webapp.ModalityFilter;
import org.apache.commons.collections4.iterators.IteratorEnumeration;
import org.eclipse.jetty.servlet.ServletTester;
@@ -34,7 +32,6 @@
import javax.servlet.DispatcherType;
import javax.servlet.FilterConfig;
import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
diff --git a/modality-webapp-auth/src/test/java/com/republicate/modality/webapp/auth/HTTPBasicAuthTests.java b/modality-webapp-auth/src/test/java/com/republicate/modality/webapp/auth/HTTPBasicAuthTests.java
index c4cdf90..7da63bc 100644
--- a/modality-webapp-auth/src/test/java/com/republicate/modality/webapp/auth/HTTPBasicAuthTests.java
+++ b/modality-webapp-auth/src/test/java/com/republicate/modality/webapp/auth/HTTPBasicAuthTests.java
@@ -23,7 +23,7 @@
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
-import com.republicate.modality.util.TypeUtils;
+import com.republicate.modality.util.ConversionUtils;
import com.republicate.modality.webapp.WebappModelProvider;
import org.junit.After;
import org.junit.Before;
@@ -110,7 +110,7 @@ public void testBadAuthenticate() throws Exception
@Test
public void testGoodAuthenticate() throws Exception
{
- String b64 = TypeUtils.base64Encode("nestor:secret");
+ String b64 = ConversionUtils.base64Encode("nestor:secret");
String request =
"GET / HTTP/1.1\r\n" +
"Host: test\r\n" +
diff --git a/modality-webapp/pom.xml b/modality-webapp/pom.xml
index 936332e..7360bb0 100644
--- a/modality-webapp/pom.xml
+++ b/modality-webapp/pom.xml
@@ -22,7 +22,7 @@ under the License.
com.republicate.modality
modality
- 1.1
+ 2.0
modality-webapp
diff --git a/pom.xml b/pom.xml
index b05f5e9..9a768dd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -27,7 +27,7 @@ under the License.
com.republicate.modality
modality
- 1.1
+ 2.0
pom
${project.groupId}:${project.artifactId}
diff --git a/velocity-tools-apiclient/pom.xml b/velocity-tools-apiclient/pom.xml
index 2eb86b8..7189135 100644
--- a/velocity-tools-apiclient/pom.xml
+++ b/velocity-tools-apiclient/pom.xml
@@ -22,7 +22,7 @@ under the License.
com.republicate.modality
modality
- 1.1
+ 2.0
velocity-tools-apiclient
diff --git a/velocity-tools-model/pom.xml b/velocity-tools-model/pom.xml
index 186f628..03ac562 100644
--- a/velocity-tools-model/pom.xml
+++ b/velocity-tools-model/pom.xml
@@ -22,7 +22,8 @@ under the License.
com.republicate.modality
modality
- 1.1
+
+ 2.0
velocity-tools-model
diff --git a/velocity-tools-model/src/main/java/com/republicate/modality/tools/model/InstanceReference.java b/velocity-tools-model/src/main/java/com/republicate/modality/tools/model/InstanceReference.java
index f260afc..b795c65 100644
--- a/velocity-tools-model/src/main/java/com/republicate/modality/tools/model/InstanceReference.java
+++ b/velocity-tools-model/src/main/java/com/republicate/modality/tools/model/InstanceReference.java
@@ -21,7 +21,6 @@
import com.republicate.modality.Instance;
import com.republicate.modality.Model;
-import com.republicate.modality.util.SlotMap;
import java.io.Serializable;
import java.sql.SQLException;
@@ -30,7 +29,7 @@
import java.util.Map;
import java.util.Set;
-public class InstanceReference implements Reference, SlotMap
+public class InstanceReference implements Reference, Map, Serializable
{
public InstanceReference(Instance instance, ModelTool modelReference)
{