I'm sure I'm misunderstanding something, but here's my problem:
I have a Category object which has a manytomany relationship with a
Course object, and the Course object in turn has a manytomany
relationship with the Category object, both through the join table
CategoryCourses. When I add a Course to a Category:
myCategory.addcourses(myCourse) it works fine however on my edit Course
page I have a listing of which Category the Course is in and this only
gets updated if I reset the application. I'm using lazy loading on both
sides, how do I make sure they stay in sync in the cache?
Thanks in advance,
Casey
From what I think you're asking - you're trying to do bidrectional manytomany?
You can only do one set of configuration per relationship, so
bideirectional manytomany is not supported.
It is something that people have discussed in the past, so it may be
considered for the future.
Mark
Thanks!
Casey
category.addCourses( course );
course.addCategories( category );
transfer.save(category);
transfer.save(course);
I put checks in to make sure they didn't have the relationship already,
then the remove is the same idea just with remove instead of add.
Hope that helps!
Casey
Mark