2017-09-11 20:39
@jounzhang 和 jfinal版本没有关系, 纯属于 java 基础部分
2017-09-11 20:37
@jounzhang 是说用 dao 对象承载了数据 还没出现问题 ?
还是说开发时没有存在用dao承载数据的问题啊?
----------------------------------
不用 dao 对象承载数据 就没事~
2017-08-30 10:42
Model 拥有这些功能:
/**
* Remove attributes of this model.
* @param attrs the attribute names of the model
* @return this model
*/
public M remove(String... attrs) {
if (attrs != null)
for (String a : attrs) {
this.attrs.remove(a);
this.getModifyFlag().remove(a);
}
return (M)this;
}
/**
* Keep attributes of this model and remove other attributes.
* @param attrs the attribute names of the model
* @return this model
*/
public M keep(String... attrs) {
if (attrs != null && attrs.length > 0) {
Config config = getConfig();
Map newAttrs = config.containerFactory.getAttrsMap(); // new HashMap(attrs.length);
Set newModifyFlag = config.containerFactory.getModifyFlagSet(); // new HashSet();
for (String a : attrs) {
if (this.attrs.containsKey(a)) // prevent put null value to the newColumns
newAttrs.put(a, this.attrs.get(a));
if (this.getModifyFlag().contains(a))
newModifyFlag.add(a);
}
this.attrs = newAttrs;
this.modifyFlag = newModifyFlag;
}
else {
this.attrs.clear();
this.getModifyFlag().clear();
}
return (M)this;
}