File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mapping Entity beans to Tables

 
Rishi Singh
Ranch Hand
Posts: 321
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8927
Firefox Browser Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use Views for this purpose. Some app servers like weblogic have explicit support for this.
 
Vishwa Kumba
Ranch Hand
Posts: 1066
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I use views to map the different columns from multiple tables in entity beans, can I insert/delete rows?
 
krithika desai
Ranch Hand
Posts: 33
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you can provided the view is updateable.
 
Sivasundaram Umapathy
Ranch Hand
Posts: 360
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But Updatable views are not recommended as they dont give good performance .Views are ideal only for read only purposes.
 
Rishi Singh
Ranch Hand
Posts: 321
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8927
Firefox Browser Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic