Bidirectional Many to Many with BaseClass and tablePerHierarchy false fails

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Bidirectional Many to Many with BaseClass and tablePerHierarchy false fails

Tobias Manthey
The following example is based on the official bidirectional many-to-many example and will fails with

org.hibernate.AssertionFailure: Table mm_author_books not found

The change is basically deriving from an even emtpy subclass with just with tablePerHierachy set to false. As any uni-directional many-to-many mapping does work based on the same principles I believe this is a bug.

class SomeBase { static mapping = { tablePerHierarchy false } } class Book extends SomeBase { String title static belongsTo = Author static hasMany = [authors: Author] static mapping = { authors joinTable: [name: "mm_author_books", key: 'mm_book_id' ] } } class Author extends SomeBase { String name List books static hasMany = [books: Book] static mapping = { books joinTable: [name: "mm_author_books", key: 'mm_author_id'] } }

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/c65cca70-bc8f-4ba1-972e-5c525f172d85%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.