实体bean的设计问题

alibaba2002 03-02-11

各位请教一个问题:实体bean的属性,是不是必须与数据库的表内容一致?

bo_y
2003-04-04 12:23

不一定,对于少量字段可以用属性直接设置,
对于大量的信息最好封装起来,提高效率

banq
2003-04-05 13:09

如果你使用CMP 需要一致的

Jevang
2003-04-05 13:59

Not necessarily, you are dealing with O/R mapping here, it can be very fancy, one to one, one to many, many2one etc. A property in EJB can be transient, which is not exist in DB at all, or a property can be a compound one.