• 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

Is it Possible...

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,
Does anyone know if its possible to have a CMP Bean that represents information from two tables. i have a tb_user and tb_student and i want to create a bean that will represent both sets of fields?
can anyone help?
 
Ranch Hand
Posts: 314
2
Android VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,
No it's not possible at this time. There has been some discussion about this feature on the JBoss forums and the consensus reached is as follows:
1. Multi-table CMP entity beans will be supported in JBoss 4.0.
2. The JBoss group will implement this feature for you on a consulting-type basis (NB: Read as '$$$').
3. In the bean time, write each table as its own bean and establish CMR relationships between them.
Sucks, I know, but there you go!
Darryl
 
Darryl A. J. Staflund
Ranch Hand
Posts: 314
2
Android VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually,
There may be a work-around that you might want to consider:
1. Create a database view of the data you want to encapsulate in a single entity bean.
2. Create database rules that will intercept insert, update, and delete requests send to the view and have them map the view fields to the appropriate tables.
3. Create a CMP entity bean that works off the view instead of the tables.
I believe this should work if your database will support it.
Darryl
 
Alan Hicks
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Cheers,
Thats given me food for thought.
Alan.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic