2017-01-19 09:53
@小三上酒 既然你是手动生成的,那你的属性有没有映射对了,他baseXX属性与表字段是这样对应的:
@SuppressWarnings("serial")
public abstract class BaseAbout> extends Model implements IBean {
public void setId(java.lang.Integer id) {
set("id", id);
}
public java.lang.Integer getId() {
return get("id");
}
public void setTitle(java.lang.String title) {
set("title", title);
}
public java.lang.String getTitle() {
return get("title");
}
public void setContent(java.lang.String content) {
set("content", content);
}
public java.lang.String getContent() {
return get("content");
}
public void setCreateAt(java.lang.String createAt) {
set("create_at", createAt);
}
public java.lang.String getCreateAt() {
return get("create_at");
}
}
回头看下你这手动生成的Basexx是不是与上面贴码的一样,其实再看下_MappingKit这个类的内容是不是中如:
public class _MappingKit {
public static void mapping(ActiveRecordPlugin arp) {
arp.addMapping("about", "id", About.class);
arp.addMapping("cases", "id", Cases.class);
arp.addMapping("client", "id", Client.class);
arp.addMapping("contact", "id", Contact.class);
arp.addMapping("news", "id", News.class);
arp.addMapping("resource", "id", Resource.class);
arp.addMapping("role", "id", Role.class);
arp.addMapping("role_resource", "id", RoleResource.class);
arp.addMapping("s_log", "id", SLog.class);
arp.addMapping("seo", "id", Seo.class);
arp.addMapping("seo_log", "id", SeoLog.class);
arp.addMapping("service", "id", Service.class);
arp.addMapping("user", "id", User.class);
arp.addMapping("user_role", "id", UserRole.class);
}
}
如果不是赶紧调整。
2017-01-18 10:03
@yinhongakg 对了,如果你想用中间件的话,这里有:http://www.oschina.net/news/69360/kisso-3-5,这个中间件,也有集成例子,即拿即用。