> >>
> >>If I use the jbosscmp-jdbc.xml file I can get it to work.
> >>
> > 
> > Do you have to use the jbosscmp-jdbc.xml file?  If you 
> don't, what happens?
> > Does the system generate two columns with the same name?
> >  
> 
> The database table already exsists. Basically I have to use 
> foreign-key-fields and set field-name and column-name 
> attributes the same.

Ok, now we are getting somewhere.  If you want to use an existing database
structure you must tell JBossCMP about it.  JAWS had the same requirement.
If your database happens to work by default, well you were lucky.  We make
no gaurentees that JBossCMP will map by default the way you want.  We may
decide that a default name was stupid and change it.  Let make this very
very very very clear.
 
All column names are either generated, or specified in the jbosscmp-jdbc.xml
file.
 
> > All column names are either generated, or specified in the 
> jbosscmp-jdbc.xml
> > file.  Your opinion is that when jboss generates the column 
> name for a
> > relationship fk it should first attempt to the name of the cmr-field
> > abstract accessors.  Problems occur when the entity does not have an
> > accessor for the relationship, and when the primary key 
> related entity maps
> > to more then one db column.  What is your complete proposal 
> for fk column
> > generation and relation-table column generation? Be specific.
> > 
> 
> Not quite I suggest you use the name of the cmr-field-name in the 
> ejb-relationship. therefore when creating the column the field always 
> has to be there.

What about many-to-one unidirectiona relationships that wish to use a fk?

> Now after great thought how do you keep the columns straight 
> in a multi 
> column pk? So if table1 has a primary key of a,b,c and the 
> foregin key 
> in the table2 is e,f,g and then to find the key a=g,b=f and 
> c=e how do 
> you specify this now?  There is no guarantee on the order the 
> fields are 
> pulled out of the primary key. Is the order we specify them in the 
> <cmp-field><field-name> have to be the same on both sides of 
> the relation?
> 
> Once you answer this I can pull the rest of the proposal together.
 
Order has nothing to do with this.  Each pk field is mapped by name in the
foreign-key-fields element or the table-fields element.

<foreign-key-fields>
   <foreign-key-field>
      <field-name>a</field-name> 
      <column-name>e</column-name> 
   </foreign-key-field>
   <foreign-key-field>
      <field-name>b</field-name> 
      <column-name>f</column-name> 
   </foreign-key-field>
   <foreign-key-field>
      <field-name>c</field-name> 
      <column-name>g</column-name> 
   </foreign-key-field>
</foreign-key-fields>

All of this information is mainatined in the field objects (see the bridge
package).
 
-dain

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to