-
1. Re: CMR - Complex Link Possible?
jcowgar Oct 25, 2002 6:40 PM (in response to jcowgar)Guess I asked a hard one?
Jeremy Cowgar -
2. Re: CMR - Complex Link Possible?
jboynes Oct 28, 2002 1:08 PM (in response to jcowgar)Without changing the database schema, I don't think you can use CMR for this. The relationship depends on additional data (the 'p' or 'c' literal for 'type') which isn't available to JBossCMP. It's the same thing that prevents you adding a fk constraint in the database.
If you can change the schema, there are a couple of options:
Option 1, use a relation-table mapping, which will require an additional table for each relation (patient->note, provider->note). This just adds to your existing schema (e.g. if you have compatibility issues).
Option 2, have separate tables for each note type (patient_note, provider_note), making the 'type' field unnecessary. This would allow a simple foreign-key CMR (and permit fk constraints in the db if that's important to you) but would require you to introduce EJBs for the different note types - Patient->PatientNote, Provider->ProviderNote (of course, they can share implementation).