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

About Multiple Tables involved in a single CMP Bean

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Would anybody please tell me, whether I can use CMP Entity bean to refer multiple fields in more than one table. For example, I have a UserEJB which will refer to a table named USER_PROFILE, USER_ADDRESS, ACCOUNT_INFO and ORDER_TABLE. I want to make those fields under the UserEJB and keep persisted by the Container.
Can I do so? THX a LOT
 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, a single EJB may represent multiple tables, however it can be more difficult to create and deploy these EJB's. In particular if you are using 3rd party DB mapping tools to create your EJB definitions, alot of these do not support multiple table beans meaning you have to understand alot more about using the xml deployment descriptors and EJB mapping
 
Anavel Gato
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So Does it mean it is better to have a view of those tables instead of using the Entity Bean to create such a relationship among those tables.
As I am so confused, from some posts many recommend we should make entity bean as a coast grain instead of a fine grained one and also they will say this is a bad practice to have an entity bean for a single table. So it implies me that I should do the entity bean to include all the tables related to the entity logic. But now that it is said that it is hard to do so...
I would think that having a view of those will be suitable. Am I correct?
 
Any sufficiently advanced technology will be used as a cat toy. And this tiny ad contains a very small cat:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic