• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mapping Entity Beans

 
kri shan
Ranch Hand
Posts: 1478
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can i map my Entity Bean with more than one table ?
Can i map my Entity Bean with View(virtual table) ? because view is also a table.
 
Arul Prasad
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

it is not possible to map the entity bean with more than one table but one table can have may entity bean...

next view is not a pure table it is a virtual table and it is based on the base table select query

so we cant map the entity bean with view

entity bean is one which is the representation of one entity or record in the DB

 
Valentin Tanase
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kri,


Can i map my Entity Bean with more than one table ?

No accordingly to the specs, yes accordingly to some container vendors. For example WebLogic allow you mapping an EJB component to multiple database tables.

Can i map my Entity Bean with View(virtual table) ? because view is also a table.

Yes you can. However you�ll have an obvious problem trying to update your database, since views are read only. It will work just fine with BMP and it might work very well with CMP if your container provides kind of ReadOnly concurrency strategy out of the box. I remember about some other tricks, when mapping entity EJBs to database views using CMP: creating a database trigger that intercepts all updates and insertions and redirect them to the real tables.
Regards.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic