我使用JBoss-IDE做的,配置文件不需要手工写,只要在代码中使用
/**
 * @hibernate.list cascade = "all" lazy = "true"
 * @hibernate.collection-key column = "message"
 * @hibernate.collection-index column = "cntid"
 * @hibernate.collection-one-to-many class = "chdw.Content"
 */
再运行一次Xdoclet就会自动生成好对应的hbm.xml文件了(这个功能应该是Hibernate中带的一个Ant任务来完成的)

解决方案 »

  1.   

    请问楼上:
    /**
     * @hibernate.list cascade = "all" lazy = "true"
     * @hibernate.collection-key column = "message"
     * @hibernate.collection-index column = "cntid"
     * @hibernate.collection-one-to-many class = "chdw.Content"
     */
    部分内容需要手工录入吗?不用*,用/行不行?如下所示:/ @hibernate.list cascade = "all" lazy = "true"
    / @hibernate.collection-key column = "message"
    / @hibernate.collection-index column = "cntid"
    / @hibernate.collection-one-to-many class = "chdw.Content"
      

  2.   

    格式是必须如此的,是标准的Xdoclet格式,
    但是如果用Eclipse + JBoss-IDE会自动有提示的,包括后面的属性及可选值,
    所以其实写起上来很容易的