hibernate +struts2有关问题!

   阅读
hibernate +struts2问题!!!
在stuTemp.hbm.xml中有如下配置,就是stuTemp和subjectinfo是多对一关系,在stuTemp表中有外键sub_id

  <many-to-one class="hibernate.model.Subjectinfo" fetch="select" name="subjectinfo">
  <column name="sub_id"/>
  </many-to-one>

请问我查询了subjectinfo表中的字段的时候,我怎样获取 stuTemp表中的stuId??

下面是想判断如果students表的ID在subjectinfo表中不为空或者subjectinfo的ID在stuTemp表中不为空的话,就可以。。。。

<s:if test='students!=null ||subjectinfo.stutemp.subId!=null' >
</s:if>

红色部分怎么写?那样是不对的

------解决方案--------------------
subjectinfo.stutemp.subId!=null 直接那样用? 应该用el导航吧
------解决方案--------------------
类似:
Student s = (Student) ss.get(i);
s.getClasses().getCid();
取出所属的班级信息,再取班级的id
------解决方案--------------------
${!empty subjectinfo.stutemp.subId }
应该这样用
------解决方案--------------------
探讨
刚才没写完
<c:if test="${!empty subjectinfo.stutemp.subId }"/>
这下写全了

------解决方案--------------------
顶!
阅读
上一篇:ssh报的一个异常 下一篇:返回列表