File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes Mapping Entity Beans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Mapping Entity Beans" Watch "Mapping Entity Beans" New topic
Author

Mapping Entity Beans

kri shan
Ranch Hand

Joined: Apr 08, 2004
Posts: 1373
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

Joined: Jan 20, 2005
Posts: 57
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



With Regards<br />Arul
Valentin Tanase
Ranch Hand

Joined: Feb 17, 2005
Posts: 704
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.


I think, therefore I exist -- Rene Descartes
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Mapping Entity Beans