NutzCN Logo
问答 @One报错 一对一关系怎么写,
发布于 1946天前 作者 daheimao888 2021 次浏览 复制 上一个帖子 下一个帖子
标签:
org.nutz.dao.DaoException: Invalid @One(field=GROUP_ID) 'menu' : class game.lottery.web.creditadmin.common.entity.Permission<=>class game.lottery.web.creditadmin.common.entity.SysMenu
	at org.nutz.dao.impl.entity.field.OneLinkField.<init>(OneLinkField.java:38)
	at org.nutz.dao.impl.entity.AnnotationEntityMaker.make(AnnotationEntityMaker.java:261)
	at org.nutz.dao.impl.EntityHolder.getEntity(EntityHolder.java:71)
	at org.nutz.dao.impl.entity.field.AbstractLinkField.getLinkedEntity(AbstractLinkField.java:72)
	at org.nutz.dao.impl.entity.field.ManyManyLinkField._make(ManyManyLinkField.java:59)
	at org.nutz.dao.impl.entity.field.ManyManyLinkField.<init>(ManyManyLinkField.java:53)
	at org.nutz.dao.impl.entity.AnnotationEntityMaker.make(AnnotationEntityMaker.java:269)
	at org.nutz.dao.impl.EntityHolder.getEntity(EntityHolder.java:71)
	at org.nutz.dao.impl.entity.field.AbstractLinkField.getLinkedEntity(AbstractLinkField.java:72)
	at org.nutz.dao.impl.entity.field.ManyManyLinkField._make(ManyManyLinkField.java:59)
	at org.nutz.dao.impl.entity.field.ManyManyLinkField.<init>(ManyManyLinkField.java:53)
	at org.nutz.dao.impl.entity.AnnotationEntityMaker.make(AnnotationEntityMaker.java:269)
	at org.nutz.dao.impl.EntityHolder.getEntity(EntityHolder.java:71)
	at org.nutz.dao.impl.NutDao.fetch(NutDao.java:529)
	at game.lottery.web.creditadmin.system.service.SysIndexService.login(SysIndexService.java:49)
	at game.lottery.web.creditadmin.system.action.SysIndexAction.toLogin(SysIndexAction.java:73)
	at game.lottery.web.creditadmin.system.action.SysIndexAction$$FASTCLASS._invoke(SysIndexAction.java:1)
	at org.nutz.lang.reflect.AbstractFastClass.invoke(AbstractFastClass.java:143)
	at org.nutz.lang.reflect.FastClassFactory.invoke(FastClassFactory.java:67)
	at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:27)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:33)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:58)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.integration.shiro.NutShiroProcessor.process(NutShiroProcessor.java:126)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:123)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
@Table("sys_permission")
public class Permission extends BaseEntity implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -5986002427452331204L;

	@Name
	@Column("PERMISSION_ID")
	private String permissionID;
	
	@Column("PERMISSION_NAME")
	private String permissionName;
	
	@Column("PERMISSION_DESC")
	private String permissionDesc;
	
	@Column("PERMISSION_ORDER")
	private long permissionOrder;
	
	@Column("PERMISSION_TYPE")
	private long permissionType;
	
	@Column("PERMISSION_URL")
	private String permissionUrl;
	
	@Column("GROUP_ID")
	private long groupID;
	
	@One(field="GROUP_ID")
	private SysMenu menu;
	
	@Column("STATUS")
	private boolean status = true;

	@ManyMany(from="permission_id", relation="sys_permission_resource", target=Resource.class, to="resource_id")
	private List<Resource> resources;
	
@Table("sys_menu")
public class SysMenu {

    @Id(auto=false)
    @Column("id")
	private long id;
	
	@Column("menu_name")
	private String menuName;
2 回复

field写java属性名,不是数据库字段名

@wendal
万分谢谢 wendal

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