MainSetup 中自动建表
val dao = nc.ioc.get(Dao::class.java)
Daos.createTablesInPackage(dao, "com.reone.onepass.model", false)
UserAuth类中,表名t_user_auth
@Name
@ColDefine(type = ColType.VARCHAR , width = 32)
@Prev(els = {@EL("uuid()")})
private String id;
/**
* 用户Id
*/
@Column
private int userId;
@One(field = "userId")
private User user;
User类中,表名t_user
@Id
private int id;
/**
* 用户账户信息Id
*/
private String authId;
/**
* 用户账户信息
*/
@One(field = "authId")
private UserAuth auth;
运行报错
Table 't_user_auth' doesn't exist!
org.nutz.dao.DaoException: Invalid @One(field=authId) 'auth' : class com.reone.onepass.model.User<=>class com.reone.onepass.model.UserAuth
是我写的有什么问题么