我使用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任务来完成的)
/**
* @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任务来完成的)
解决方案 »
- 一个字符串,怎么转换为数组?
- 做ajax时遇到一个问题,问问大家~
- 大家讨论下如何使java程序更健壮
- 并发测试EJB的问题,请高手帮忙,发我MAIL( [email protected] )或回复,万分感谢
- 大家来说说, 关于 EJB3 的问题!!
- struts MAC
- 本人学java时间不长,是个菜鸟,先遇到hibernate 数据库级连方面一个问题往高手给解决下
- 请问在hibernate中什么时候要用到po的关联?
- 无聊写个小东西玩一下,初学java的一定用的上
- 请真正知道weblogic6.1+struts1.0.2问题的朋友回答!很急,谢谢
- 请问用struts做报表选择什么样的报表软件比较好?
- 一个struts的例子,验证不成功时,转到相应页面,但成功时却不跳转
/**
* @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"
但是如果用Eclipse + JBoss-IDE会自动有提示的,包括后面的属性及可选值,
所以其实写起上来很容易的