How to adjust constraints / DB mapping for Map within grails domain class

前端 未结 2 1425
生来不讨喜
生来不讨喜 2020-12-11 07:05

Following grails domain class:

class MyClass {
  Map myMap
}

Now for myMap, grails automatically creates a new table for the elements in th

2条回答
  •  爱一瞬间的悲伤
    2020-12-11 07:10

    what are you trying to accomplish? Is there always the same number of things in the map? If there is you should define those properties on your class.

    You can see the problem with your current approach -- there is no way to figure out what might be in the map until runtime, so how can grails possibly create a columns for it? Im surprised it even worked to begin with...

提交回复
热议问题