This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Mapping 4 database tables using single CMP bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Mapping 4 database tables using single CMP bean" Watch "Mapping 4 database tables using single CMP bean" New topic
Author

Mapping 4 database tables using single CMP bean

Raj Prasad
Greenhorn

Joined: Jan 25, 2006
Posts: 7
How to map 4 database tables using single CMP bean?

I want to insert, update and delete operations using the bean.

Thanks,
Raj
Bill Shirley
Ranch Hand

Joined: Nov 08, 2007
Posts: 457
Most likely, you need a good book on EJB 3.0!

If you are using the Container Manager Persistence implemented in Enterprise Java Beans 3.0, you should check the documentation of the @SecondaryTable annotation.

You will also be interested in @SecondaryTables, @Table, and @Column.

Each secondary table will need to be able to be joined to the main table.


Bill Shirley - bshirley - frazerbilt.com
if (Posts < 30) you.read( JavaRanchFAQ);
Raj Prasad
Greenhorn

Joined: Jan 25, 2006
Posts: 7
Is it possible with EJB 2.0?

I want to map 2 to 3 tables using CMP EJB? How do i do that?
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30085
    
149

Originally posted by Raj Prasad:
Is it possible with EJB 2.0?

It is possible in EJB 2.1. EJB changed quite a bit between 2.0 and 2.1. I don't remember if it was possible in 2.0.

It tends to be app server specific though. For example, here's how to do it in WebLogic.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
wood burning stoves
 
subject: Mapping 4 database tables using single CMP bean
 
Similar Threads
CMP Entity Bean
Entity bean representing a query
Is it Possible...
CMp bean...
Container managed Entity Beans