Michael Harm
2003-10-18 16:22:01 UTC
Hi.
Sorry if this is a silly one.. I'm new to this.
We have a set of tables that are sort of a shared resource to be used
across multiple projects. It's in a schema called "vocabulary" (on
oracle 9i).
There are other projects that use these tables, with foreign key
relationships into them. Those projects each are in their own schema.
I'd like to be able to deploy these projects separately into jboss
(3.2.1), each in their own WAR file, but preserving the CMR
relationships to "vocabulary".
But middlegen operates at the granularity of a single schema, as near
as I can tell. So the CMR relationships don't happen. I can run
middlegen twice for a given project, once on, say, "clinical_trials",
and again on "vocabulary", but it doesn't kick out the right cmr stuff.
ejbdoclet lets me add additional entity descriptors to the
ejb-jar.xml, but doesn't seem to have a hook for additional
<ejb-relation> thingies. And maybe it's a bad idea to have an entitity
(say, a bean from the "vocabulary" schema) existing in multiple WAR
files anyway.
I've tried using oracle's synonyms, creating a synonym of
vocabulary.concept as 'concept' visible in schema 'clinical_trials'
with the fk relationship on that, but middlegen still doesn't see the
'concept' guy, even if its explicitly named in the <table> directives.
I've also tried leaving off the 'schema' attribute to the middlegen
task and coding the schema prefix in the <table> directives, but it
doesn't see the tables with a schema prefix.
What's the best practice for having a bean that is used across multiple
projects? Keep everything in the same schema, and each project picks
the stuff it needs using the middlegen <table> directive rather than
scooping in everything? Is there a danger in having beans referencing
a given table deployed to multiple WAR files? Or is jboss smart enough
to figure this out?
I'll get more concrete: in schema vocabulary, there's a table called
CONCEPT with pk concept_id. In schema clinical_trials there's a table
TRIAL, with a field trial_type_id. It's got a foreign key relationship
to vocabulary.concept(concept_id). When I do a project relating to
clinical_trials, I'd like to end up with cmr relationships, and be able
to get to the concept bean. And there's another project in schema
clinical_repository that has other tables with fk relationships into
vocabulary.concept(concept_id), and I'd like those to be able to
reference a concept bean as well.
Any tips on the right way to architect this?
(in this case, the stuff in the 'vocabulary' schema is all read-only.
That may help with this particular case, and any info that would be
great, but I'd also like to know about the more general case where the
shared schema isn't readonly).
Thanks!
Michael Harm
Stanford University School of Medicine
Sorry if this is a silly one.. I'm new to this.
We have a set of tables that are sort of a shared resource to be used
across multiple projects. It's in a schema called "vocabulary" (on
oracle 9i).
There are other projects that use these tables, with foreign key
relationships into them. Those projects each are in their own schema.
I'd like to be able to deploy these projects separately into jboss
(3.2.1), each in their own WAR file, but preserving the CMR
relationships to "vocabulary".
But middlegen operates at the granularity of a single schema, as near
as I can tell. So the CMR relationships don't happen. I can run
middlegen twice for a given project, once on, say, "clinical_trials",
and again on "vocabulary", but it doesn't kick out the right cmr stuff.
ejbdoclet lets me add additional entity descriptors to the
ejb-jar.xml, but doesn't seem to have a hook for additional
<ejb-relation> thingies. And maybe it's a bad idea to have an entitity
(say, a bean from the "vocabulary" schema) existing in multiple WAR
files anyway.
I've tried using oracle's synonyms, creating a synonym of
vocabulary.concept as 'concept' visible in schema 'clinical_trials'
with the fk relationship on that, but middlegen still doesn't see the
'concept' guy, even if its explicitly named in the <table> directives.
I've also tried leaving off the 'schema' attribute to the middlegen
task and coding the schema prefix in the <table> directives, but it
doesn't see the tables with a schema prefix.
What's the best practice for having a bean that is used across multiple
projects? Keep everything in the same schema, and each project picks
the stuff it needs using the middlegen <table> directive rather than
scooping in everything? Is there a danger in having beans referencing
a given table deployed to multiple WAR files? Or is jboss smart enough
to figure this out?
I'll get more concrete: in schema vocabulary, there's a table called
CONCEPT with pk concept_id. In schema clinical_trials there's a table
TRIAL, with a field trial_type_id. It's got a foreign key relationship
to vocabulary.concept(concept_id). When I do a project relating to
clinical_trials, I'd like to end up with cmr relationships, and be able
to get to the concept bean. And there's another project in schema
clinical_repository that has other tables with fk relationships into
vocabulary.concept(concept_id), and I'd like those to be able to
reference a concept bean as well.
Any tips on the right way to architect this?
(in this case, the stuff in the 'vocabulary' schema is all read-only.
That may help with this particular case, and any info that would be
great, but I'd also like to know about the more general case where the
shared schema isn't readonly).
Thanks!
Michael Harm
Stanford University School of Medicine