@@ -120,5 +120,7 @@ public interface IRow<M> {
* Convert to json string.
*/
public String toJson();
+
+ public boolean isEmpty();
}
@@ -1244,9 +1244,15 @@ public abstract class Model<M extends Model> implements IRow<M>, Serializable {
return templateByString(content, model.attrs);
+ @Override
public Map<String, Object> toMap() {
return attrs;
+ public boolean isEmpty() {
+ return attrs.isEmpty();
+ }
@@ -491,6 +491,11 @@ public class Record implements IRow<Record>, Serializable {
getColumns().put(key, value);
return this;
+ return columns != null ? columns.isEmpty() : true;