• 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

modelling an association with entity beans

 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi there,
i have a problem with understanding the use of container managed relations (CMR). as far as i have learned i can use CMR to store primary key (from table a) and foreign key (primary key of table b which is referenced from a table a's attribute) and don't need to create an entity bean to maintain a table containing of 2 attributes (primary key of table a and primary key of table b). I guess this is the case in all different cardinalities (1:1, 1:n, m:n).
so in case i want to model an association (table a primarky key, table b primary key and additional attributes), i have to create an entity bean ? is there a way to add attributes besides primary and foreign key to a CMR ?
many thanx for your answers,
max
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Trenks ,
In cardinalities m:n cardinality , u have to maintain the direent table that will store the table a primary key , table b primary key and additional attributes. so in this way u can store the attribute.
Thanks
ashwani

Originally posted by Maximilian Trenks:
hi there,
i have a problem with understanding the use of container managed relations (CMR). as far as i have learned i can use CMR to store primary key (from table a) and foreign key (primary key of table b which is referenced from a table a's attribute) and don't need to create an entity bean to maintain a table containing of 2 attributes (primary key of table a and primary key of table b). I guess this is the case in all different cardinalities (1:1, 1:n, m:n).
so in case i want to model an association (table a primarky key, table b primary key and additional attributes), i have to create an entity bean ? is there a way to add attributes besides primary and foreign key to a CMR ?
many thanx for your answers,
max

 
Maximilian Trenks
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi ashwani,
can you post an example thats shows an association ?
bean code and deployment descriptors please in case they are available.
thanx,
max
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic