在hbm里把这两个表关联起来就可以了

解决方案 »

  1.   

    http://dev.csdn.net/article/67/67332.shtm中的第一个cat是什么,要和第四个一样?
      

  2.   

    Query query = session.createSQLQuery("select {a.*},{b.*} from contract a, corporation_customer b where a.contract_status_cd >= 6 and b.customer_num = a.customer_num", new String[] {"a", "b" }, new Class[] {ContractBO.class, CustomerBaseBO.class});
    List list = query.list();
    以上处理后,我要分别取对象a和b的一些属性,然后拼出一个新类。
    不知道怎么取a和b的属性值
      

  3.   

    给你一个新的,简单的方法,在数据库中创建一个VIEW,相关联这两个表,在你的hibernate中,直接映射这个VIEW.方法是如此简单,如此可行.不用复杂的配置hibernate .
      

  4.   

    class Test extends ABo
    在Text内容和Bbo的一样,这就是他的bean。
      

  5.   

    class View{
       Date date;
       Long id;
       String name;   public View(Long aid,String aname,Date adte){ 
           date = adate;
           name =aname;
           id = aid;
       }
    }select new View(a.id,a.name,b.date) from a, b where a.name=b.name------------
    返回的结果就是View对象.