哪位给讲讲~~
另,再问一个,要在两个实体bean间建立关联,是不是一定要通过数据库相应表间建立主键和外键的关联才可以?那,这主键和外键是不是都得在实体bean的域(cmr-field)中?
另,再问一个,要在两个实体bean间建立关联,是不是一定要通过数据库相应表间建立主键和外键的关联才可以?那,这主键和外键是不是都得在实体bean的域(cmr-field)中?
解决方案 »
- MyEclipse 9.01M不能在线安装svn插件
- 安了aptana插件,怎么找回熟悉的dynamic web project呢
- struts 简单的问题
- sql语句查询问题
- 导入EMF(2.2.1)、GEF(3.2.1)、VE(1.2.1)、VE-runtime-1.2.1好难!
- 下部个人菜单原理
- Struts2整合Spring框架问题,请高手帮忙
- 如何写一个blog首页?roller weblogger相关
- 请教Spring整合Hibernate的注入顺序的两个问题?
- 请教一个javamail的问题?
- 如何发布在JBuilder X里用wsdl生成的一个web service?
- struts架构下能否在jsp页面里直接得到action form对象的引用?
They are linked through a foreign key. * Your first create stament will create a record in the User table * Your second create statement will create a record in the UserInfo table * The setUserInfo call will establish the relationship between the two records.> 要在两个实体bean间建立关联,是不是一定要通过数据库相应表间建立主键和外键的关联才可以?Usually yes, but it's EJB implementation dependent.> 那,这主键和外键是不是都得在实体bean的域(cmr-field)中?It depends on the kinds of relationships.You define a CMR field on the source CMP bean if the destination bean is navigable. For example, if you have a Customer bean and an Address bean and they have a one-to-many unidirectional relationship, then only on Customer bean you need to define a CMR field "addresses" and provide methods such as getAddresses(). On Address, you shouldn't define any CMR field because Customer is not navigable from Address.