jfinal 2.2 如何给model自定义属性

tianxia007 发布于 2016/02/11 19:48
阅读 1K+
收藏 0

@JFinal

如何给model自定义属性,某些场景下可能突然要给加个信号属性。

加载中
0
铂金蛋蛋
铂金蛋蛋

model中有put方法

/**
	 * Put key value pair to the model without check attribute name.
	 */
	public M put(String key, Object value) {
		attrs.put(key, value);
		return (M)this;
	}
	
	/**
	 * Put map to the model without check attribute name.
	 */
	public M put(Map<String, Object> map) {
		attrs.putAll(map);
		return (M)this;
	}
	
	/**
	 * Put other model to the model without check attribute name.
	 */
	public M put(Model model) {
		attrs.putAll(model.getAttrs());
		return (M)this;
	}
	
	/**
	 * Put record to the model without check attribute name.
	 */
	public M put(Record record) {
		attrs.putAll(record.getColumns());
		return (M)this;
	}



返回顶部
顶部