Use Map as property of model in Play

前端 未结 3 1039
日久生厌
日久生厌 2021-02-04 17:33

I\'m trying to use a Map as a type for one of my models properties. Let\'s take these two classes for example:

@Entity
public class Foo extends Model {

    @One         


        
3条回答
  •  猫巷女王i
    2021-02-04 18:22

    I had the same issue in v1.2.3 with Fixtures. Strangely if I didn't define a fixture below the one with the bi-directional Map OneToMany relationship there wasn't a problem. I also had a problem in one of my controllers if I didn't setup the bi-directional relationship completely. It does seem to be directly related to using a Map in a bi-directional OneToMany relationship. I switched to a Set and the problem went away. In the end I managed to resolve the situation without reverting to a Set by upgrading to v1.2.4RC2. I had a quick look through the change list in v1.2.4RC2 but couldn't spot anything that directly mentioned fixing this issue but something must have been resolved.

提交回复
热议问题