0

I'm trying to copy an entitiy to create a new entity from Hibernate, with Dozer.

So far, everything has gone good. But one field has lazy loading turned on. Dozer expects a Map but since it's lazy loaded, it gets an java.util.Collections$UnmodifiableMap.

Is there any way of forcing it to load the "real" Map-object?

I've tried setting a field-hint in the mapping XML, but to no avail. Is there any good Javassist / Hibernate proxy thing to fix the Unmodifiable map problem?

Regards

Robin Jonsson
  • 2,761
  • 3
  • 22
  • 42

1 Answers1

0

Not sure about the Javassist / Hibernate side of things, but have you tried creating a custom- converter for the field? That will essentially allow you to write your a mini java snippet to transfer the data in that specific field.

M21B8
  • 1,867
  • 10
  • 20
  • Any tips on how to do it? Is it through the setCustomFieldMapping? How do i get it to only convert a specified field? Regards – Robin Jonsson Feb 01 '14 at 19:35
  • Take a look at the solution here http://stackoverflow.com/questions/5552379/prevent-dozer-from-triggering-hibernate-lazy-loading . This shows how to create the mapping and how to specify it in the mapping xml. – M21B8 Feb 03 '14 at 11:14