建议你看看 hibernate 的书
这种类似的问题,在书上已经说的很详细了如何映射,如何建立关系,如何反向关联或者双向关联,一对多,多对一,多对多等等甚至延迟加载等等。。

解决方案 »

  1.   

    你现在的问题好象不是1楼兄弟所说的配置问题,你是不知道怎么在标签里面写。
    这个就查查 struts 方面的东西,对不起,我不熟悉这个。但我提议你试一下这个:
    <td > <bean:write name="temp" property="customer.customerId"/ > </td > <!--客户编号-- >
    <td > <bean:write name="temp" property="customer.customerName"/ > </td > <!--客户名字-- > 
      

  2.   

    用bean:define,然后再用bean:write啊....
      

  3.   

    在迭代标签里写<tr > 
     
    <td >xxxxx </td > 
    <td >客户编号 </td > 
    <td >客户名字 </td > 
    </tr > 
      

  4.   

    看你有没有级连关系了
    如果在order里面塞了customer信息   那直接customer.xx如果么塞customer,那单独传个customer对象过来
    每个调的地方也是customer.xx
      

  5.   

    3楼的大哥,你说的方法不行啊!
    我试了property="customer.customerId"不行,property="${customer.customerId}"也不行怎么办呢?
    回复7楼:我用的是MySQL数据库,如果即使用你那样的方法,不会搞乱顺序么?
      

  6.   


    <logic:iterate id="temp" name="orders" > <!--order包括所有定单-- > 
    <tr> 
    <td> <bean:write name="temp" property="orderId"/> </td > 
    <td> <bean:write name="temp" property="orderDes"/> </td > 
    <!--可是下面怎么输出客户编号和名字???-- > 
    <td>${temp.customer.customerId}</td> <!--客户编号-- > 
    <td>${temp.customer.customerName}</td> <!--客户名字-- > 
    </tr> 
      </logic:iterate >
      

  7.   

    9楼说的方法有用,非常感谢!!!
    我根据4楼的提醒,用define方法也试成功,谢谢。
    不过9楼的方法更简单,而且回答也具体,分就给这位仁兄了。谢谢。
      

  8.   

    不过用“<td><bean:write name="temp" property="${customer.customerId}"/></td> ”怎么会没有用呢?我看它和用“<td>${temp.customer.customerId}</td>”的方法差不多啊?有没有哪位兄弟能解释一下?
      

  9.   

    temp.customer取得对像
    temp.customer.customerId取得对像的customerId