Questions tagged [dozer]

Dozer is a Java Bean to Java Bean mapper that recursively copies data from one object to another. Typically, these Java Beans will be of different complex types.

From the Dozer website:

Dozer is a Java Bean to Java Bean mapper that recursively copies data from one object to another. Typically, these Java Beans will be of different complex types.

Dozer supports simple property mapping, complex type mapping, bi-directional mapping, implicit-explicit mapping, as well as recursive mapping. This includes mapping collection attributes that also need mapping at the element level.

Dozer not only supports mapping between attribute names, but also automatically converting between types. Most conversion scenarios are supported out of the box, but Dozer also allows you to specify custom conversions via XML.

530 questions
3
votes
0 answers

Equivalent of Java Orika/Dozer/MapStruct Data mapper for PHP (Laravel/Eloquent)?

I'm wondering if there's an analogue of java's Orika data mapper for PHP/Laravel/etc? I've looked around and seen Doctrine etc, but these seem to just be ORM's. What I need is to map/import from an old archaic (badly normalised database) into a new…
wired00
  • 13,930
  • 7
  • 70
  • 73
3
votes
1 answer

MappingException: InvocationTargetException

I have a small problem here and hope that someone can help me out. I wanna do a mapping from Object to Integer. The Object is marked as Fetchtype.Lazy. When I do the mapping I get the following error message: 11:31:46,569 ERROR MappingProcessor:253…
MUG4N
  • 19,377
  • 11
  • 56
  • 83
3
votes
0 answers

Dozer deep mapping object to map

Can dozer do deep mapping complex object to map? For example, I have object class A { String aField; List listOfBs; } class B { C cField; } class C { String fieldInC; } In result I need the following map: { aField:…
Squeez
  • 919
  • 2
  • 12
  • 30
3
votes
1 answer

Dozer mapping not working for nested object

I was Trying to copy value of StudentRequestForm class to StudentEntity class .all values are saved but a classI field in studentBean is not saved which is mapped to StudentEntity classId .So i want my ClassI value copy to classId you can check…
tarun
  • 33
  • 5
3
votes
1 answer

Dozer Mapper is not mapping composed nested fields

Tools/Frameworks in use: JDK 1.7 Spring 3.2.5.RELEASE Dozer 5.5.1 Class: BaseModel.java package com.demo.model; public class BaseModel { protected Long createdBy; protected Timestamp createdTimestamp; protected Long updatedBy; protected…
Niranjan
  • 2,601
  • 8
  • 43
  • 54
3
votes
4 answers

How to map String values to a String list using Dozer?

Hi I try to map following Source class in to following Destination class. I used following mapping in order to map string values in to the list string. It isn't mapping properly. I need to know how to map 2 string values into one destination string…
Miraj Hamid
  • 554
  • 10
  • 19
3
votes
1 answer

Dozer not calling my CustomConverters

Dozer is not calling my CustomConverter no matter what I seem to do. I tried to put breakpoints and none of the CustomerConverter code is ever called. The objects are converting, all fields but the ones linked to the CustomConverter are working. In…
Stephane Grenier
  • 15,527
  • 38
  • 117
  • 192
3
votes
1 answer

why DozerConverter is not working?

I am using dozer version 5.5.1. And i want to configure my custom converter so i have this import org.dozer.DozerConverter; import com.example.movies.api.models.response.ClientResponseDTO; public class MyCustomConverter extends…
jscherman
  • 5,839
  • 14
  • 46
  • 88
3
votes
4 answers

Dozer mapping for Hibernate object to DTO

I try to use Dozer to convert my domain entity to DTO objects. So, I want to convert PersistentList, PersistentBag, ... from my domain entity to ArrayList, ... in my DTO objects to avoid lazy problem. This is an example of two of my domain entity…
sylsau
  • 31
  • 1
  • 1
  • 3
3
votes
1 answer

Dozer Mapping field type="one-way" not working as expected

As per the Dozer documentation the one-way fields are only mapped when "a" object is mapped to "b" object. If "b" is mapped to "a", then the field is not mapped. But for the below code "b" is still getting mapped to "a".
ShajuK
  • 31
  • 2
3
votes
1 answer

Hibernate + Dozer - Using map-id on mapped collection items property

I have two hibernate entities: @Entity @Table(name = DBConstants.TABLE_PARTNER) public class Partner extends XWeedEntity { private static final long serialVersionUID = 5692151244956513381L; @Id @Column(name =…
xmartinez
  • 65
  • 6
3
votes
1 answer

Dozer Mapping Class level is-accessible

I am using dozer framework for cloning my objects. I want dozer framework to clone the data without using the getters and setters and for this I am setting the is-accessible property at the class level. But this does not seem to work. When I set…
Sherin Syriac
  • 447
  • 6
  • 13
3
votes
1 answer

Dozer API Date Mapping config without XML

Anyone know how to convert the following into the api call format for Dozer? The documentation on the Dozer mapping site is pretty slim when it comes to the java mappings. MM/dd/yyyy…
chrislhardin
  • 1,747
  • 1
  • 28
  • 44
3
votes
1 answer

Mapping Avro Models

I'm looking to map Avro models. Given an input of Avro A, I need to transform it and return back Avro B. The use case is that I receive Avro models from a service, transform them to match our use case, and restore them in a new Avro model. Currently…
baweaver
  • 304
  • 1
  • 12
3
votes
2 answers

InstantiationException when Mapping a Class with Abstract Type Member in Dozer

I'm new to dozer and I'm trying to create a map for ClassA and ClassB public class ClassA { ClassC c; public ClassC getC() { return c; } public void setC(ClassC c) { this.c = c; } } public class ClassB { …
jchips12
  • 1,177
  • 1
  • 11
  • 27