NutzCN Logo
问答 关于@One 的问题
发布于 2446天前 作者 _Yuuki 2145 次浏览 复制 上一个帖子 下一个帖子
标签:
Caused by: org.nutz.dao.DaoException: Invalid @One(field=uId) 'user' : class com.jiguan.readingaloud.common.entity.TeacherVerify<=>class com.jiguan.readingaloud.common.entity.User
	at org.nutz.dao.impl.entity.field.OneLinkField.<init>(OneLinkField.java:38)
	at org.nutz.dao.impl.entity.AnnotationEntityMaker.make(AnnotationEntityMaker.java:290)
	at org.nutz.dao.impl.EntityHolder.getEntity(EntityHolder.java:72)
	at org.nutz.dao.impl.NutDao.getEntity(NutDao.java:682)
	at org.nutz.dao.util.Daos$3.compare(Daos.java:461)
	at org.nutz.dao.util.Daos$3.compare(Daos.java:458)
	at java.util.TimSort.countRunAndMakeAscending(TimSort.java:355)
	at java.util.TimSort.sort(TimSort.java:220)
	at java.util.Arrays.sort(Arrays.java:1512)
	at java.util.ArrayList.sort(ArrayList.java:1454)
	at java.util.Collections.sort(Collections.java:175)
	at org.nutz.dao.util.Daos.createTablesInPackage(Daos.java:458)
	at com.jiguan.readingaloud.MainSetup.init(MainSetup.java:18)
	at org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:278)
	at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:121)
	... 55 more

为什么会报这个错啊?

@Table("e_teacher_verify")
@Data
public class TeacherVerify extends BasePojo implements Serializable {


    @Id
    @Column
    @ColDefine(type = ColType.INT)
    private int id;

    @One(field = "uId")
    @Column
    public User user;

    @Column
    @ColDefine(type = ColType.VARCHAR,width = 40)
    private String verifyPic;

    @Column
    @ColDefine(type = ColType.VARCHAR,width = 10)
    private String name;

    @Column
    @ColDefine(type = ColType.VARCHAR,width = 20)
    private String schoolName;

    @Column
    @ColDefine(type = ColType.BOOLEAN)
    @Prev(els = @EL("$me.flag()"))
    private boolean pass;

}
1 回复

关联字段必须列出

添加回复
请先登陆
回到顶部