• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

Mapping Entity beans to Tables

 
Ranch Hand
Posts: 321
  • 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
 
Ranch Hand
Posts: 8943
Firefox Browser Spring Java
  • 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.
 
Ranch Hand
Posts: 1066
  • 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?
 
Ranch Hand
Posts: 33
  • 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: 8943
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you can provided the view is updateable.
 
Ranch Hand
Posts: 360
  • 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
  • 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: 8943
Firefox Browser Spring Java
  • 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.
 
What's that smell? I think this tiny ad may have stepped in something.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic