• 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

CMP and Multiple Table Mappings

 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Greetings,

I was wondering if there was a way in JBoss to have a single entity bean, but map it's CMP fields to multiple tables that share a one-to-one relationship?

For example, assume I have an entity bean called PersonBean. In PersonBean, I have CMP fields such as name, address, etc. However, the tables that contain the data are separate; tbl_person and tbl_person_address share a one-to-one relationship.

Rather than creating an entity bean for PersonAddress and using CMR (which I think may be an anti-pattern, but I'm not sure about this), I would instead like to use some sort of deployment mapping to have the fields from both tables exist in the single bean.

This is possible. It is mentioned in the J2EE Tutorial (Second Ed.) for Sun Application Server and in WebLogic documentation. However, I have found no mention of it in JBoss documentation (including the JBoss CMP docs).

If there is a JBoss solution, is there any way to map the fields to the beans using XDoclet? Geez, I'm asking for a lot, aren't I? :-)

TIA for any assistance!

Cheers,
Jason
 
I'm so happy! And I wish to make this tiny ad happy too:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic