Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

One to One CMR  RSS feed

 
Dana Hanna
Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
  • 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?
 
David Harkness
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!