NutzCN Logo
问答 Fail to find comosite field 'user_id'
发布于 2356天前 作者 mapway 2066 次浏览 复制 上一个帖子 下一个帖子
标签:

如下:
一个实体类,插入数据时出现 下面的错误,帮忙解释一下,谢谢

@org.nutz.dao.entity.annotation.Table("s_user_role")
@org.nutz.dao.entity.annotation.PK({"user_id","role_id"})
public class S_USER_ROLEObj
     {
  public static final String TBL_S_USER_ROLE = "s_user_role";
  public S_USER_ROLEObj() {
  }
  @org.nutz.dao.entity.annotation.Column("user_id")
  public Long userId;
  @org.nutz.dao.entity.annotation.Column("role_id")
  public Long roleId;

java.lang.RuntimeException: Fail to find comosite field 'user_id' in class 'cn.mapway.workday.ui.shared.repository.S_USER_ROLEObj'!
	at org.nutz.lang.Lang.makeThrow(Lang.java:132) ~[nutz-1.r.60.jar:na]
	at org.nutz.dao.impl.entity.NutEntity.checkCompositeFields(NutEntity.java:266) ~[nutz-1.r.60.jar:na]
	at org.nutz.dao.impl.entity.AnnotationEntityMaker.make(AnnotationEntityMaker.java:272) ~[nutz-1.r.60.jar:na]
	at org.nutz.dao.impl.EntityHolder.getEntity(EntityHolder.java:71) ~[nutz-1.r.60.jar:na]
	at org.nutz.dao.impl.EntityHolder.getEntityBy(EntityHolder.java:201) ~[nutz-1.r.60.jar:na]
	at org.nutz.dao.impl.NutDao._optBy(NutDao.java:935) ~[nutz-1.r.60.jar:na]
	at org.nutz.dao.impl.NutDao.insert(NutDao.java:128) ~[nutz-1.r.60.jar:na]
	at cn.mapway.workday.service.WorkdayService.registerUser(WorkdayService.java:96) ~[classes/:na]
	at cn.mapway.workday.api.WorkdayController.registerUser(WorkdayController.java:50) ~[classes/:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_144]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_144]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_144]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_144]
	at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-4.3.6.RELEASE.jar:4.3.6.RELEASE]
	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133) ~[spring-web-4.3.6.RELEASE.jar:4.3.6.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:116) ~[spring-webmvc-4.3.6.RELEASE.jar:4.3.6.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827) ~[spring-webmvc-4.3.6.RELEASE.jar:4.3.6.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738) ~[spring-webmvc-4.3.6.RELEASE.jar:4.3.6.RELEASE]
	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) ~[spring-webmvc-4.3.6.RELEASE.jar:4.3.6.RELEASE]
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963) ~[spring-webmvc-4.3.6.RELEASE.jar:4.3.6.RELEASE]
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897) ~[spring-webmvc-4.3.6.RELEASE.jar:4.3.6.RELEASE]
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) ~[spring-webmvc-4.3.6.RELEASE.jar:4.3.6.RELEASE]
	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872) ~[spring-webmvc-4.3.6.RELEASE.jar:4.3.6.RELEASE]
2 回复

@Pk写的是 JAVA属性名

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