• 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

One to One CMR

 
Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hope I have the right forum...
I'm looking to define a 1 to 0..1 relationship in CMR using XDoclet and deploying to JBoss. The relationship of the bean is a relationship to itself represented in a table like this:

Where parent_id refers to another customer (imagine it as the holding company of a customer - which is a customer as well...). I'd need getParent() and getChild() methods (bidirectional) as well as the associated setters. Again, this is using XDoclet...
Any tips?
 
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First, I'd make sure that a 1:0..1 is what you really want. You used a holding company as an example, but can't one holding company hold multiple companies? Also, your customer table could allow a 1:N relationship. Otherwise, XDoclet will do this fine. I don't have time to test it, but here's a start.
 
That feels good. Thanks. Here's a tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic