RE: Re[2]: [JBoss-user] JBossCMP Change Column Names in CMR
Yep, here's the snipped out of my ejb-jar.xml: ejb-relation ejb-relation-nameUser-Roles/ejb-relation-name ejb-relationship-role ejb-relationship-role-nameUser-has-multiple-Roles/ejb-relationship-role-n ame multiplicityMany/multiplicity relationship-role-source ejb-nameUsers/ejb-name /relationship-role-source cmr-field cmr-field-nameroles/cmr-field-name cmr-field-typejava.util.Set/cmr-field-type /cmr-field /ejb-relationship-role ejb-relationship-role ejb-relationship-role-nameRole-Belongs-To-User/ejb-relationship-role-name multiplicityMany/multiplicity relationship-role-source ejb-nameRoles/ejb-name /relationship-role-source cmr-field cmr-field-nameusers/cmr-field-name cmr-field-typejava.util.Set/cmr-field-type /cmr-field /ejb-relationship-role /ejb-relation Do I need todo something else here to make the other work? It's deployed fine and the code works perfectly. I only run into problems when i added the section in the jbosscmp-jdbc.xml to attempt to change the column-names. thanks. .peter -Original Message- From: Alex Loubyansky [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 31, 2002 11:13 AM To: Luttrell, Peter Subject: Re[2]: [JBoss-user] JBossCMP Change Column Names in CMR AFAIK, DD's are correct (with my remark). Do you really have in the beans abstract accessors for cmr users and roles? Wednesday, July 31, 2002, 6:47:55 PM, you wrote: LP I actually tried that and it didn't work either. LP The only difference is that instead of complaining that it couldn't find LP roles, now it complains that it can't find users. LP Any other ideas? LP thanks. LP .peter LP -Original Message- LP From: Alex Loubyansky [mailto:[EMAIL PROTECTED]] LP Sent: Wednesday, July 31, 2002 1:11 AM LP To: Peter Luttrell LP Subject: Re: [JBoss-user] JBossCMP Change Column Names in CMR LP You need to interchange key-fields for ejb-relationship-role's in LP jbosscmp-jdbc.xml. LP I.e. LP ejb-relationship-role-nameRole-Belongs-To-User/ejb-relationship-role-name LPkey-fields LP key-field LP field-nameroles/field-name LP column-namerole_name/column-name LP /key-field LP/key-fields LP ... LP alex LP Wednesday, July 31, 2002, 1:45:57 AM, you wrote: PL How do you change the column names for a table generated by a LP MANY-to-MANY PL CMR? PL Here's an example of what i've tried: PL ejb-jar.xml: PL ejb-relation PL ejb-relation-nameUser-Roles/ejb-relation-name PL ejb-relationship-role PL LP ejb-relationship-role-nameUser-has-multiple-Roles/ejb-relationship-role-n ame PL multiplicityMany/multiplicity PL relationship-role-source PL ejb-nameUsers/ejb-name PL /relationship-role-source PL cmr-field PL cmr-field-nameroles/cmr-field-name PL cmr-field-typejava.util.Set/cmr-field-type PL /cmr-field PL /ejb-relationship-role PL ejb-relationship-role PL LP ejb-relationship-role-nameRole-Belongs-To-User/ejb-relationship-role-name PL multiplicityMany/multiplicity PL relationship-role-source PL ejb-nameRoles/ejb-name PL /relationship-role-source PL cmr-field PL cmr-field-nameusers/cmr-field-name PL cmr-field-typejava.util.Set/cmr-field-type PL /cmr-field PL /ejb-relationship-role PL /ejb-relation PL My understanding of how to do this is via this entry in LP jbosscmp-jdbc.xml: PL ejb-relation PL ejb-relation-nameUser-Roles/ejb-relation-name PL relation-table-mapping PL table-nameUser_Role/table-name PL /relation-table-mapping PL ejb-relationship-role PL LP ejb-relationship-role-nameRole-Belongs-To-User/ejb-relationship-role-name PL key-fields PL key-field PL field-nameusers/field-name PL column-nameuser_name/column-name PL /key-field PL /key-fields PL /ejb-relationship-role PL ejb-relationship-role PL LP ejb-relationship-role-nameUser-has-multiple-Roles/ejb-relationship-role-n ame PL key-fields PL key-field PL field-nameroles/field-name PL column-namerole_name/column-name PL /key-field PL /key-fields PL /ejb-relationship-role PL /ejb
RE: Re[2]: [JBoss-user] JBossCMP Change Column Names in CMR
I found the solution to my problem, so i thought i'd post it in case anyone else runs into the same problem. In the jbosscmp-jdbc.xml file, for the field-name fields, instead of the cmr fields that i was specifying, you need to specify the primarykey fields for the related beans. Thus this: ejb-relation ejb-relation-nameUser-Roles/ejb-relation-name relation-table-mapping table-nameUser_Role/table-name /relation-table-mapping ejb-relationship-role ejb-relationship-role-nameRole-Belongs-To-User/ejb-relationship-role-name key-fields key-field field-nameroles/field-name column-namerole_name/column-name /key-field /key-fields /ejb-relationship-role ejb-relationship-role ejb-relationship-role-nameUser-has-multiple-Roles/ejb-relationship-role-n ame key-fields key-field field-nameusers/field-name column-nameuser_name/column-name /key-field /key-fields /ejb-relationship-role /ejb-relation Becomes this: ejb-relation ejb-relation-nameUser-Roles/ejb-relation-name relation-table-mapping table-nameUser_Role/table-name /relation-table-mapping ejb-relationship-role ejb-relationship-role-nameRole-Belongs-To-User/ejb-relationship-role-name key-fields key-field field-namename/field-name column-namerole_name/column-name /key-field /key-fields /ejb-relationship-role ejb-relationship-role ejb-relationship-role-nameUser-has-multiple-Roles/ejb-relationship-role-n ame key-fields key-field field-nameuserName/field-name column-nameuser_name/column-name /key-field /key-fields /ejb-relationship-role /ejb-relation To figure it out, I used middlegen to reverse engineer my dbschema, at which point i noticed that the field-names weren't what I was doing. .peter -Original Message- From: Alex Loubyansky [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 31, 2002 11:13 AM To: Luttrell, Peter Subject: Re[2]: [JBoss-user] JBossCMP Change Column Names in CMR AFAIK, DD's are correct (with my remark). Do you really have in the beans abstract accessors for cmr users and roles? Wednesday, July 31, 2002, 6:47:55 PM, you wrote: LP I actually tried that and it didn't work either. LP The only difference is that instead of complaining that it couldn't find LP roles, now it complains that it can't find users. LP Any other ideas? LP thanks. LP .peter LP -Original Message- LP From: Alex Loubyansky [mailto:[EMAIL PROTECTED]] LP Sent: Wednesday, July 31, 2002 1:11 AM LP To: Peter Luttrell LP Subject: Re: [JBoss-user] JBossCMP Change Column Names in CMR LP You need to interchange key-fields for ejb-relationship-role's in LP jbosscmp-jdbc.xml. LP I.e. LP ejb-relationship-role-nameRole-Belongs-To-User/ejb-relationship-role-name LPkey-fields LP key-field LP field-nameroles/field-name LP column-namerole_name/column-name LP /key-field LP/key-fields LP ... LP alex LP Wednesday, July 31, 2002, 1:45:57 AM, you wrote: PL How do you change the column names for a table generated by a LP MANY-to-MANY PL CMR? PL Here's an example of what i've tried: PL ejb-jar.xml: PL ejb-relation PL ejb-relation-nameUser-Roles/ejb-relation-name PL ejb-relationship-role PL LP ejb-relationship-role-nameUser-has-multiple-Roles/ejb-relationship-role-n ame PL multiplicityMany/multiplicity PL relationship-role-source PL ejb-nameUsers/ejb-name PL /relationship-role-source PL cmr-field PL cmr-field-nameroles/cmr-field-name PL cmr-field-typejava.util.Set/cmr-field-type PL /cmr-field PL /ejb-relationship-role PL ejb-relationship-role PL LP ejb-relationship-role-nameRole-Belongs-To-User/ejb-relationship-role-name PL multiplicityMany/multiplicity PL relationship-role-source PL ejb-nameRoles/ejb-name PL /relationship-role-source PL cmr-field PL cmr-field-nameusers/cmr-field-name PL cmr-field-typejava.util.Set/cmr-field-type PL /cmr-field PL /ejb-relationship-role PL /ejb-relation PL My understanding of how to do this is via this entry in LP jbosscmp-jdbc.xml: PL ejb-relation PL