• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic