java - Dozer and lazily initialize a collection error -


I am using dotger to map to a second object, but error of getting an IAM:

Use the mapping field (size) before use to do this work, but its really annoying what all the collections are r Is there an option to load hibernate objectively? |

This is not a dozer's problem. You are accessing yor data in the wrong data in your hibernate unit, You have some lazy references (collections, another organization, ...), but you are converting it into some bean outside the hibernate session (your organization is called a 'separate' state).

The solution to this problem depends on your situation. You can do the following:

  • Skip the given attributes (if you do not need it), it will not be used by the Dozer
  • In the code block Move the Dodger Conversion, which can also work with the mapped field size with lazy collections. The number of elements can be known, but not the content.

    Edit: More solutions:

    • Mark the referenced collection as eager (not lazy), but it may be slow
to initialize the lazy collection referenced.

Comments