RE: [JBoss-dev] 1 to Many Relations

2001-11-20 Thread Dain Sundstrom
> Uncle. It seems that JBOSS is designed assuming that it has > full control of creating tables. This isn't really true. JBossCMP makes the assumption that if the table structure is not specified the Application Deployer does not care what the structure is, as long as it runs. I strongly reco

Re: [JBoss-dev] 1 to Many Relations

2001-11-20 Thread Dave Smith
Uncle. It seems that JBOSS is designed assuming that it has full control of creating tables. Well in my case I already have a database allready set up so my view of things is how do I stuff this database into JBOSS. I don't think it is worth the discussion which approach is right or wrong but,

RE: [JBoss-dev] 1 to Many Relations

2001-11-19 Thread Dain Sundstrom
> >> > >>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 > for

Re: [JBoss-dev] 1 to Many Relations

2001-11-19 Thread Dave Smith
>> >>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 s

RE: [JBoss-dev] 1 to Many Relations

2001-11-19 Thread Dain Sundstrom
> > Ok, you are not getting it. > > > > I am it's just that the moon is gone ;) > > > > Although JBossCMP does not generate the column names you > would like, the > > system still runs. Is that correct? (i.e., this is still > a suggestion) > > > > If I use the jbosscmp-jdbc.xml file I ca

Re: [JBoss-dev] 1 to Many Relations

2001-11-19 Thread Dave Smith
Don't be sorry, be happy ;) the problem is that the name specified in the cmr-field-name is not the database column. Jboss assumes that the database column name is the (left side) +"_" + right side. What I think makes more sense is for the cmr_field_name by default to match the database co

Re: [JBoss-dev] 1 to Many Relations

2001-11-19 Thread Dan OConnor
Hi guys, I've just been skimming this thread, but it strikes me as possible that it is based on a misunderstanding. Dave, do you know that you should not define a cmp field for a foreign key column? So changing the naming convention wouldn't be necessary to get it to work by default. Sorry if

Re: [JBoss-dev] 1 to Many Relations

2001-11-19 Thread Dave Smith
> Ok, you are not getting it. > I am it's just that the moon is gone ;) > Although JBossCMP does not generate the column names you would like, the > system still runs. Is that correct? (i.e., this is still a suggestion) > If I use the jbosscmp-jdbc.xml file I can get it to work. > Ok now

RE: [JBoss-dev] 1 to Many Relations

2001-11-19 Thread Dain Sundstrom
Comments inline .. > > Dain Sundstrom wrote: > > >>Finally, we are on the same page ..not even a blue moon ... > >> > > > > About time :) > > > > > >>Yup this is a suggestion. I agree 100% we need to avoid using > >>jbosscmp-jdbc.xml. > >> > >> > >>Ultimately at the database level for each

Re: [JBoss-dev] 1 to Many Relations

2001-11-19 Thread Dave Smith
Comments inline .. Dain Sundstrom wrote: >>Finally, we are on the same page ..not even a blue moon ... >> > > About time :) > > >>Yup this is a suggestion. I agree 100% we need to avoid using >>jbosscmp-jdbc.xml. >> >> >>Ultimately at the database level for each table there has to >>be a u

RE: [JBoss-dev] 1 to Many Relations

2001-11-17 Thread Dain Sundstrom
> > Finally, we are on the same page ..not even a blue moon ... About time :) > Yup this is a suggestion. I agree 100% we need to avoid using > jbosscmp-jdbc.xml. > > > Ultimately at the database level for each table there has to > be a unique > column name(s) that acts as a foreign key

Re: [JBoss-dev] 1 to Many Relations

2001-11-16 Thread Dmitri Colebatch
ok - sorry... cheers dim On Fri, 16 Nov 2001, Dave Smith wrote: > I know. The point is as far as I am concered this is the most basic of > cases. We want to avoid users having to know jboss'isms unless they are > doing something quite weird. > > > > Dmitri Colebatch wrote: > > > You can s

Re: [JBoss-dev] 1 to Many Relations

2001-11-16 Thread Dave Smith
I know. The point is as far as I am concered this is the most basic of cases. We want to avoid users having to know jboss'isms unless they are doing something quite weird. Dmitri Colebatch wrote: > You can set a different column name using @jboss:column-name (see > http://xdoclet.sourceforge

Re: [JBoss-dev] 1 to Many Relations

2001-11-16 Thread Dmitri Colebatch
You can set a different column name using @jboss:column-name (see http://xdoclet.sourceforge.net/jboss.html#column-name) cheers dim On Fri, 16 Nov 2001, Dave Smith wrote: > I'm using xdoclet to generate the ejb-jar.xml file. When you are > generating the accessor methods it automaticly assumes

Re: [JBoss-dev] 1 to Many Relations

2001-11-16 Thread Dave Smith
quiring a jbosscmp-jdbc.xml file. When explaining the suggestion explain > why you would not get a name collision. > > -dain > > >>-Original Message- >>From: Dave Smith [mailto:[EMAIL PROTECTED]] >>Sent: Friday, November 16, 2001 12:22 PM >>To: Dain

RE: [JBoss-dev] 1 to Many Relations

2001-11-16 Thread Dain Sundstrom
12:22 PM > To: Dain Sundstrom > Cc: [EMAIL PROTECTED] > Subject: Re: [JBoss-dev] 1 to Many Relations > > > When it tries to load the CDTrack relation it generates the following > sql statement .. > > select uuid from CDTrack where composer_composed_songs=? > >

Re: [JBoss-dev] 1 to Many Relations

2001-11-16 Thread Dave Smith
When it tries to load the CDTrack relation it generates the following sql statement .. select uuid from CDTrack where composer_composed_songs=? should be .. select uuid from CDTrack where composer=? Dain Sundstrom wrote: >>I'm using xdoclet to generate the ejb-jar.xml file. When you are >>

RE: [JBoss-dev] 1 to Many Relations

2001-11-16 Thread Dain Sundstrom
> I'm using xdoclet to generate the ejb-jar.xml file. When you are > generating the accessor methods it automaticly assumes that > the accessor > name matches the database column name. So in your example by > default it > is looking for a database columns named composer and performer. > > Th

Re: [JBoss-dev] 1 to Many Relations

2001-11-16 Thread Dave Smith
I'm using xdoclet to generate the ejb-jar.xml file. When you are generating the accessor methods it automaticly assumes that the accessor name matches the database column name. So in your example by default it is looking for a database columns named composer and performer. This is a packaging

RE: [JBoss-dev] 1 to Many Relations

2001-11-16 Thread Dain Sundstrom
> Dain Sundstrom wrote: > > >>OK i'm playing with the latest RH CVS and testing out 1 to many > >>relations (bi directional). So .. > >> > >>Table1 { > >> primary_key int, > >>} > >> > >>TableMany { > >> primary_key int, > >> table1_key int, > >>} > >> > >>class Table1 { > >> int getPrimar

Re: [JBoss-dev] 1 to Many Relations

2001-11-16 Thread Dave Smith
Dain Sundstrom wrote: >>OK i'm playing with the latest RH CVS and testing out 1 to many >>relations (bi directional). So .. >> >>Table1 { >> primary_key int, >>} >> >>TableMany { >> primary_key int, >> table1_key int, >>} >> >>class Table1 { >> int getPrimary_key() >> Collection getTab

RE: [JBoss-dev] 1 to Many Relations

2001-11-15 Thread Dain Sundstrom
> > OK i'm playing with the latest RH CVS and testing out 1 to many > relations (bi directional). So .. > > Table1 { > primary_key int, > } > > TableMany { > primary_key int, > table1_key int, > } > > class Table1 { >int getPrimary_key() >Collection getTableMany(); > } > > cla

[JBoss-dev] 1 to Many Relations

2001-11-15 Thread Dave Smith
OK i'm playing with the latest RH CVS and testing out 1 to many relations (bi directional). So .. Table1 { primary_key int, } TableMany { primary_key int, table1_key int, } class Table1 { int getPrimary_key() Collection getTableMany(); } class TableMany { int getPrimary_key();