• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Mapping Entity beans to Tables

 
Ranch Hand
Posts: 321
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 8944
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use Views for this purpose. Some app servers like weblogic have explicit support for this.
 
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 8944
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, you can provided the view is updateable.
 
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 8944
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rishi,
Weblogic 7.0 supports mapping an entity to muliple tables. You need not use views.
 
reply
    Bookmark Topic Watch Topic
  • New Topic