On Thursday 15 May 2008 2:00:52 pm Steve Mayzak wrote:
> Burt,
>
> Thanks for the quick reply. I should have checked JIRA first...
> Has this tripped you, or anyone else, up in working with the database with
> DBA's etc?
>
> On Thu, May 15, 2008 at 10:57 AM, Burt Beckwith <
burt@...>
>
> wrote:
> > This is intentional - see
http://jira.codehaus.org/browse/GRAILS-828
> >
> > You can re-reverse them using the mapping closure.
> >
> > Burt
> >
> > On Thursday 15 May 2008 1:50:24 pm Steve Mayzak wrote:
> > > I have a m-m relationship mapped like so:
> > >
> > > class Product{
> > > static hasMany = [categories:Category]
> > > ...other fields here
> > > }
> > >
> > > class Category{
> > > static hasMany = [products:Product]
> > > static belongsTo = Product
> > > ....other fields here
> > > }
> > >
> > > This creates 3 tables (names not exact)
> > > Product
> > > Product_Categories
> > > Category
> > >
> > > The problem is that when I associate a product with a category by doing
> > > this:
> > > product.addToCateogries(Category.get(1)) //or something similar
> > > product.save()
> > >
> > > the Product_categories table gets the IDs in the wrong column. The
> >
> > Product
> >
> > > id goes into the category_id column and vice versa.
> > >
> > > Any ideas? I am not sure what I am doing wrong here...
> > >
> > > Thanks,
> > > Steve
> >
> > ---------------------------------------------------------------------
> > To unsubscribe from this list, please visit:
> >
> >
http://xircles.codehaus.org/manage_email
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email