Should I convert my Grails domain relations to use Hibernate Bags? [closed]
Asked Answered
S

0

6

In Grails 1.3.7 I've spent quite some time to convert my domain class relations according to Burt's suggestions in http://www.infoq.com/presentations/GORM-Performance

Now, Grails 2 supports Hibernate's Bags and I am considering to revert my changes back to hasMany/belongsTo.

  1. With which option will I be more future-proof?
  2. Which problems might arise if I stick to the manual/explicit implementation?
  3. Which problems might arise if I switch to Bags?
  4. Is there any advantage in either variant compared to the other?

Note that the application will see long-term improvements over many years (so no 'deploy-and-forget' :).

UPDATE: One main concern is how much hassle it would incur in regards to manual changes in the database if I did the change after the app goes live. Currently it is unreleased, so it poses to be reasonable before Go-Live.

UPDATE: THE ANSWER

In the blogpost 'Hibernate Bags in Grails 2.0' dated November 2011, Burt Beckwith describes issues with Bags in Grails 2 and concludes:

So I guess I’m back to advocating the approach from my earlier talks; don’t map a collection of Books in the Author class, but add an Author field to the Book class instead

So the answer is to stick with the converted (i.e. non-set/-list/-bag) variant.

Please vote for re-opening this thread so it may be answered & accepted in correct fashion.

Syzygy answered 21/9, 2011 at 16:53 Comment(2)
Your comment is ambiguous: 'already implemented' in the app (the old style) or 'already implemented' in the framework (new feature/style). Also, I'd be curious for reasons.Syzygy
first of all, wait until grails 2.0 is really outSangsanger

© 2022 - 2024 — McMap. All rights reserved.