• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

question about entity bean

 
Ranch Hand
Posts: 416
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello
can i map one CMP-entitybean to multiple database table?
thank you
 
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In my experience so far, which is limited to EJB 1.1 and is only a few weeks old, an entity bean is tied to a single table. However, custom finder methods can be defined that use joins, a technique more standardized and easier in EJB 2.0, to find one or a collection of your bean instances based on criteria in multiple tables. The documentation for your J2EE server should include some information on declaring custom finders that use joins.
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It depends on your vendor. For instance, in WebSphere we do allow some simple joins in defining your table mapping so you can in fact map a single entity bean to more than one table.
Kyle
 
Craig Demyanovich
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This thought has just occurred to me based on your post, Kyle: Can an entity bean be based on a view, either via CMP or BMP, EJB 1.1 or 2.0? I have a little work here that takes precedence, but I'll check this thread later and have a look at the relevant specs.
 
Kyle Brown
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, as I said, it depends on your vendor. In WebSphere, the answer is no, for either version. The reason is you usually can't update a View...
Kyle
reply
    Bookmark Topic Watch Topic
  • New Topic