• Post Reply Bookmark Topic Watch Topic
  • New Topic

modelling an association with entity beans

 
Maximilian Trenks
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • 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
 
ashwani singhal
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!