<id name="stuId" type="java.lang.Integer" unsaved-value="0">
<column name="stu_id" />
<generator class="native" />
</id>
有必要吗? 映射表出了两个stuId Getter时肯定有突出.有了多对一的关系.主表就不要再设主键了.
<column name="stu_id" />
<generator class="native" />
</id>
有必要吗? 映射表出了两个stuId Getter时肯定有突出.有了多对一的关系.主表就不要再设主键了.
解决方案 »
- Ajax dwr框架 返回函数
- The method getDataSource(HttpServletRequest) is undefined for the type LoginAction
- 请问java如何调节摄像头的属性,例如亮度对比度等等。
- spring(2.0)测试问题
- 如何用jdom读出属性id的值?
- 能不能在j2se1.5的基础上升级为java EE5? --在线等
- org.apache.struts.config.CongigRuleSet
- LINUX+JBOSS环境下,验证码图片不能出来,需要在什么地方配置一下呢?!在线等!谢谢
- 在java中如何让机器发声?(在线等待,解决了马上送分)
- 求大神解救,Error creating bean with name 'eADPerforReportDao'
- Struts分页讲解与代码实例
- Lucene+Web Spider
<set name="courses" table="course_student_table" cascade="save-update" inverse="false" lazy="false">
<key column="stu_id"></key>
<many-to-many class="org.libo.db.Student" column="cou_id"></many-to-many>
</set>
怎么影射的啊?
<set name="courses" table="course_student_table" cascade="save-update" inverse="false" lazy="false">
<key column="stu_id"></key>
<many-to-many class="org.libo.db.Course" column="cou_id"></many-to-many>
</set>
<key column="classid" />
<many-to-many class="Course" column="courseid" foreign-key="fk_course"/>
</set><set name="classes" table="class_course" inverse="true">
<key column="courseid" />
<many-to-many class="Class" column="classid" foreign-key="fk_class"/>
</set>
09:30:19,661 ERROR [AbstractFlushingEventListener] Could not synchronize database state with session
org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of org.domain.jbossseamtmsoa.entity.Role.roleid
....
Caused by: java.lang.IllegalArgumentException: object is not an instance of declaring class
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:169)
... 103 more
09:30:19,668 SEVERE [application] javax.persistence.PersistenceException: org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of org.domain.jbossseamtmsoa.entity.Role.roleid
javax.faces.el.EvaluationException: javax.persistence.PersistenceException: org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of org.domain.jbossseamtmsoa.entity.Role.roleid
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
at javax.faces.component.UICommand.broadcast(UICommand.java:387)
....