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;
}
2017-08-04 00:27
public class _TppTest {
public static void main(String[] args) {
String className = "Blog";
String tableName = "blog";
JfGenerator.me
.setPackageBase("com")
.setBasePath("demo")
//.setViewFolder("")
.javaRender(className, tableName)
.htmlRender(className, tableName);
System.out.println("---------OK-刷新一下项目吧---------");
}
}