• 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

How to use one-to many relation in CMPs , i mean how to assign childs to parent

 
Ranch Hand
Posts: 551
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Thank you for reading my post.
Imagine that :
I create some CMP (so they are records in database)
now The parent CMP has a method which take a collection of child cmp home ,
is it manedatory to use this method to assign childs to a parent or it is for time that we want to change some records parent ?
because in childs CMP create method there is a parameter for parent home.

any sample could be usefull
Thank you.
 
author
Posts: 4335
39
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think what your asking is it mandatory for database references to be reflected in your CMP beans and the answer is no. You could set the references using the object id's directly yourself, although since you went through the trouble of setting up CMP in the first place, its far better to set object references that the server will resolve to database object id references.

There are many examples (ask google) for CMP with one-to-many XML snippets out there.
 
Why am I so drawn to cherry pie? I can't seem to stop. Save me tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic