This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Mapping Entity beans to Tables Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Mapping Entity beans to Tables" Watch "Mapping Entity beans to Tables" New topic
Author

Mapping Entity beans to Tables

Rishi Singh
Ranch Hand

Joined: Dec 09, 2000
Posts: 321
Hi All,
How can we map a single entity to two or more tables. If this be the case and if we are using optimistic locking strategy and Isolation level SERIALIZABLE it implies that the corresponding tables gets locked. Hoa far is this approach advisable.
Rishi
SCJP,SCWCD,IBM OOAD
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

You can use Views for this purpose. Some app servers like weblogic have explicit support for this.


Groovy
Vishwa Kumba
Ranch Hand

Joined: Aug 27, 2003
Posts: 1064
If I use views to map the different columns from multiple tables in entity beans, can I insert/delete rows?
krithika desai
Ranch Hand

Joined: Apr 02, 2003
Posts: 33
Originally posted by Pradeep Bhat:
You can use Views for this purpose. Some app servers like weblogic have explicit support for this.

I have used database views only to select. Never used it for insert and update :roll:
Now that weblogic allows me to map entity beans to views, it knows to insert into tables that make up the view ?
Have to brush up my database skills


thanks,<br />krithika
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Yes, you can provided the view is updateable.
Sivasundaram Umapathy
Ranch Hand

Joined: Aug 10, 2002
Posts: 360
But Updatable views are not recommended as they dont give good performance .Views are ideal only for read only purposes.


Siva
Co-Author - SCMAD Exam Guide - ISBN:9780070077881
Author - Java certification success, Part 4: SCEA
Rishi Singh
Ranch Hand

Joined: Dec 09, 2000
Posts: 321
Hi Everyone,
I would be very nice if someone would share his views as to how exactly it fares and does it really performs the DMLs in an efficient manner bcoz as mentioned by everyone else i have used views only for read only purpose . Someone has worked on Weblogic on this can throw some light..
Rishi
SCJP,SCWCD,IBM OOAD
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Rishi,
Weblogic 7.0 supports mapping an entity to muliple tables. You need not use views.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Mapping Entity beans to Tables