JPA and Hibernate initialize Non Lazy Collections Error

后端 未结 1 1224
离开以前
离开以前 2021-01-27 15:41

In my JavaFX application When I use Non Lazy Collection option with EmbeddedId class, for maintain bidirectional relation ship it will produce following excepti

相关标签:
1条回答
  • 2021-01-27 16:12

    Excerpt from JPA 2.0 Specification, chapter 11.1.38 OrderBy Annotation:

    The dot (".") notation is used to refer to an attribute within an embedded attribute. The value of each identifier used with the dot notation is the nameof the respective embedded field or property.

    so you should rather annotate workflowStepList with:

    @OrderBy(value = "id.stepSeqNo")
    private List<WorkflowStep> workflowStepList;
    

    thus indicating that stepSeqNo belongs to WorkflowStep embeddable.

    0 讨论(0)
提交回复
热议问题