• 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
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

question on entity bean.

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI,
I have a question about entity bean. Can a entity bean represent data from multiple tables ? what i mean is if an entity bean has 6 variable, can 4 of them represent cols of a table and the other two represent cols of another table. Is this possible.
Thanks in advance.
 
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Yes you can do it with Bean Managed Persistence(BMP)
 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Let us say that i have a customer object.
Address is part of that object.
A customer can have multiple credit cards.
With CMP, i believe, i can have the address as a serializable object and have it as part of the customer EJB.
How do i deal with the Collection of Credit card objects that are related to this customer.
Is it possible with EJB1.1
or
Is BMP the only way to deal with it?
 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can do multitable mappings with CMP.
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Friends
U can represent two tables in ur one CMP in ejb 1.1. All u need to do is make two EJBs and in your Customer Bean's ejbPostCreate() and ejbAcrtivate() you have to lookup for the specific primary key of your CreditCard bean which is associated with your particular customer. On the other way In ejbPassivate() and ejbRemove() u have to discards all the handles(References) to your CreditCard Bean. But this should not be done untill it is verry necessary, because this puts extra burdon on container.
Raajeev
 
Ajit Kumar
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does it mean.... in this type of scenario, it is advisable to go for BMP instead of having three CMPs??
 
What's wrong? Where are you going? Stop! Read this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic