如题,insert后,并没有设置@Id字段
21 回复
@Table("asje")
public class UserDream {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
private Long helpid;
@Column
private Long userid;
@Column
private String title;
}
mysql数据库
NutMap nutMap = Lang.obj2nutmap(t);
dao.insert(nutMap);
因为有关键字,我需要转换一下啊
NutMap nutMap = Lang.obj2nutmap(t);
if(nutMap.containsKey("sensitive")){
nutMap.put("sensitive
", nutMap.get("sensitive"));
nutMap.remove("sensitive");
}
dao.insert(UserDream.class, Chain.from(t,FieldMatcher.make(null, null, true)));
return Lang.map2Object(nutMap, UserDream.class);
具体怎么写的?
Chain set = Chain.from(nutMap,FieldMatcher.make(null, null, true)).addSpecial("helpid", "+1");
dao.insert(UserDream.class, set);
return Lang.map2Object(nutMap, UserDream.class);
这样也不行
我再试一下这个
nutMap.put("helpid", "+1");
nutMap.put(".table", "aaa");
dao.insert(nutMap);
return Lang.map2Object(nutMap, UserDream.class);
添加回复
请先登陆