• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to write a cmp mapping xml include 3 tables or more  RSS feed

 
pamela lee
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if there are a cmp include 3 tables,how i descript the relationships in the mapping xml?
or there are some tools for generating? :roll:
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
pamela lee... anderson???
check this links:
http://iris.cs.byu.edu/tim/462/tutorial/tutorial.html
it might help you..
I haven't used any tools.. I'm using JBoss as app server..
 
pamela lee
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thax for ur help!
still,after i know that,how i choose the mapping,ie:if 1 ,2,3,4 are four tables,these four have some relations,then i use these 4 tables as ONE cmp or there are some better mappings?
what is the key to make a mapping choice?
 
Shaha D
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Typically, each entity bean has an underlying table in a relational database. Sketch down the abstract schema showing all the relationships between different tables. You can have four types of relationships in CMP : one to one, one to many, many to one, many to many. Each of these relationships can be unidirectional or bidirectional. You can start implementing your abstract schema, as an CMP entity bean for each comonent in the diagram and implement relationships between the CMP beans. Then you can implement finder methods using the EJB-QL.
You can use JBuilder or some other IDE tool, JB generates code and xml descriptors for you, when you create beans using the EJB designer. You can find more info about tools on "IDE's and other tools" forum.
Visit the following links for more details:
http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/EJBConcepts4.html#62950
http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/EJBConcepts.html
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!