Reputation: 293
i have the following dozer mapping:
com.company.xx.xx.model.MyClass com.company.xx.xx.model.MyClassToMap
afield afield
customer customer
I load MyClass with with hibernate. But i have a lazy loading for customer. i dont load everything from customer. But the mapping wants to map all attributes from customer, so that a lazy initilization exception is thrown.
How can i tell dozer only to map customer and not all of the fields from customer?
Upvotes: 3
Views: 4123
Reputation: 32397
You can set <mapping wildcard="false">
to have Dozer only map specified fields on a particular class
Upvotes: 0
Reputation: 1216
You will need to write a custom converter to assign null to uninitialized collections. When you implement the custom converter make use of Hibernate.isInitialized check and set collections to null where it is not necessary.
The link http://dozer.sourceforge.net/documentation/customconverter.html gives an idea about custom converters.
Upvotes: 2